Solana RPC
Shakudo provides shared and dedicated RPC nodes. We support all the official Solana RPC HTTPS and WSS methods as well as some customly built methods.
Commitment
For preflight checks and transaction processing, Solana nodes choose which bank state to query based on a commitment requirement set by the client. The commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back.
In descending order of commitment (most finalized to least finalized), clients may specify:
"finalized"
- the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized"confirmed"
- the node will query the most recent block that has been voted on by supermajority of the cluster.- It incorporates votes from gossip and replay.
- It does not count votes on descendants of a block, only direct votes on that block.
- This confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards.
"processed"
- the node will query its most recent block. Note that the block may still be skipped by the cluster.
For processing many dependent transactions in series, it's recommended to use
"confirmed"
commitment, which balances speed with rollback safety.
For total safety, it's recommended to use"finalized"
commitment.
Example
The commitment parameter should be included as the last element in the params
array:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getBalance",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
{
"commitment": "finalized"
}
]
}
'
Default:
If commitment configuration is not provided, the node will default to "finalized"
commitment
Only methods that query bank state accept the commitment parameter. They are indicated in the API Reference below.
RpcResponse Structure
Many methods that take a commitment parameter return an RpcResponse JSON object comprised of two parts:
context
: An RpcResponseContext JSON structure including aslot
field at which the operation was evaluated.value
: The value returned by the operation itself.
HTTP request RPC methods
getAccountInfo
Use getAccountInfo
to get all information associated with the account of provided Pubkey
Parameters:
<string>
- Pubkey of account to query, as base-58 encoded string<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
encoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedata
field is type<string>
. - (optional)
dataSlice: <object>
- limit the returned account data using the providedoffset: <usize>
andlength: <usize>
fields; only available for "base58", "base64" or "base64+zstd" encodings. - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result will be an RpcResponse JSON object with value
equal to:
<null>
- if the requested account doesn't exist<object>
- otherwise, a JSON object containing:lamports: <u64>
, number of lamports assigned to this account, as a u64owner: <string>
, base-58 encoded Pubkey of the program this account has been assigned todata: <[string, encoding]|object>
, data associated with the account, either as encoded binary data or JSON format{<program>: <state>}
, depending on encoding parameterexecutable: <bool>
, boolean indicating if the account contains a program (and is strictly read-only)rentEpoch: <u64>
, the epoch at which this account will next owe rent, as u64
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev/ -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getAccountInfo",
"params": [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
{
"encoding": "base58"
}
]}'
const web3 = require("@solana/web3.js");
(async () => {
const publicKey = new web3.PublicKey(
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
);
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev/");
console.log(await solana.getAccountInfo(publicKey));
})();
from solana.rpc.api import Client
from solana.publickey import PublicKey
solana_client = Client("https://your-endpoint.hyperplane.dev/")
print(solana_client.get_account_info(PublicKey('vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg')))
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1
},
"value": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHRTPuR3oZ1EioKtYGiYxpxMG5vpbZLsbcBYBEmZZcMKaSoGx9JZeAuWf",
"base58"
],
"executable": false,
"lamports": 1000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 2
}
},
"id": 1
}
{
data: <Buffer >,
executable: false,
lamports: 1735614164999,
owner: PublicKey { _bn: <BN: 0> },
rentEpoch: 327
}
{
'jsonrpc': '2.0',
'result': {
'context': {
'apiVersion': '1.10.32',
'slot': 144409325},
'value': {
'data': ['', 'base64'],
'executable': False,
'lamports': 407413255,
'owner': '11111111111111111111111111111111',
'rentEpoch': 334
}
},
'id': 1
}
getBalance
Returns the balance of the account of provided Pubkey
Parameters:
<string>
- Pubkey of account to query, as base-58 encoded string<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
RpcResponse<u64>
- RpcResponse JSON object withvalue
field set to the balance
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0",
"id":1,
"method":"getBalance",
"params":["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"]
}
const web3 = require("@solana/web3.js");
(async () => {
const publicKey = new web3.PublicKey(
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
);
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getBalance(publicKey));
})();
from solana.rpc.api import Client
from solana.publickey import PublicKey
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_balance(PublicKey('vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg')))
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc":"2.0",
"result":{
"context":{
"apiVersion":"1.10.29",
"slot":141160178
},
"value":0
},
"id":1
}
297203134126
{
'jsonrpc': '2.0',
'result': {
'context': {
'apiVersion': '1.10.32',
'slot': 144701280
},
'value': 407413255
},
'id': 1
}
getBlock
Returns identity and transaction information about a confirmed block in the ledger
Parameters:
<u64>
- slot, as u64 integer<object>
- (optional) Configuration object containing the following optional fields:- (optional)
encoding: <string>
- encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". "jsonParsed" encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in thetransaction.message.instructions
list. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts
,data
, andprogramIdIndex
fields). - (optional)
transactionDetails: <string>
- level of transaction detail to return, either "full", "signatures", or "none". If parameter not provided, the default detail level is "full". - (optional)
rewards: bool
- whether to populate therewards
array. If parameter not provided, the default includes rewards. - (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
- (optional)
maxSupportedTransactionVersion: <number>
- set the max transaction version to return in responses. If the requested block contains a transaction with a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and a block containing any versioned transaction will prompt the error.
- (optional)
Results:
The result field will be an object with the following fields:
<null>
- if specified block is not confirmed<object>
- if block is confirmed, an object with the following fields:blockhash: <string>
- the blockhash of this block, as base-58 encoded stringpreviousBlockhash: <string>
- the blockhash of this block's parent, as base-58 encoded string; if the parent block is not available due to ledger cleanup, this field will return "11111111111111111111111111111111"parentSlot: <u64>
- the slot index of this block's parenttransactions: <array>
- present if "full" transaction details are requested; an array of JSON objects containing:transaction: <object|[string,encoding]>
- Transaction object, either in JSON format or encoded binary data, depending on encoding parametermeta: <object>
- transaction status metadata object, containingnull
or:err: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionsfee: <u64>
- fee this transaction was charged, as u64 integerpreBalances: <array>
- array of u64 account balances from before the transaction was processedpostBalances: <array>
- array of u64 account balances after the transaction was processedinnerInstructions: <array|null>
- List of inner instructions ornull
if inner instruction recording was not enabled during this transactionpreTokenBalances: <array|undefined>
- List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transactionpostTokenBalances: <array|undefined>
- List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transactionlogMessages: <array|null>
- array of string log messages ornull
if log message recording was not enabled during this transaction- DEPRECATED:
status: <object>
- Transaction status"Ok": <null>
- Transaction was successful"Err": <ERR>
- Transaction failed with TransactionError
loadedAddresses: <object|undefined>
- Transaction addresses loaded from address lookup tables. Undefined ifmaxSupportedTransactionVersion
is not set in request params.writable: <array[string]>
- Ordered list of base-58 encoded addresses for writable loaded accountsreadonly: <array[string]>
- Ordered list of base-58 encoded addresses for readonly loaded accounts
version: <"legacy"|number|undefined>
- Transaction version. Undefined ifmaxSupportedTransactionVersion
is not set in request params.
signatures: <array>
- present if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the blockrewards: <array>
- present if rewards are requested; an array of JSON objects containing:pubkey: <string>
- The public key, as base-58 encoded string, of the account that received the rewardlamports: <i64>
- number of reward lamports credited or debited by the account, as a i64postBalance: <u64>
- account balance in lamports after the reward was appliedrewardType: <string|undefined>
- type of reward: "fee", "rent", "voting", "staking"commission: <u8|undefined>
- vote account commission when the reward was credited, only present for voting and staking rewards
blockTime: <i64 | null>
- estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not availableblockHeight: <u64 | null>
- the number of blocks beneath this block
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id":1,
"method":"getBlock",
"params":[
430,{
"encoding": "json",
"transactionDetails":"full",
"rewards":false
}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getBlock(94101948));
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_block(144901419))
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": {
"blockHeight": 428,
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"transactions": [
{
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"logMessages": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"transaction": {
"message": {
"accountKeys": [
"3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
"AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
"SysvarS1otHashes111111111111111111111111111",
"SysvarC1ock11111111111111111111111111111111",
"Vote111111111111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 3,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [1, 2, 3, 0],
"data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
"programIdIndex": 4
}
],
"recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
},
"signatures": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
]
}
}
]
},
"id": 1
}
{
blockHeight: 127628171,
blockTime: 1657647543,
blockhash: 'HRYMsphCFt2hQrB4KgaSGySwTBuxj3xWvXJHmW6kCSTc',
parentSlot: 141303358,
previousBlockhash: 'FAz1dVSFQQjSdDHs6NJM93MyDbAuCpWUcyiyagLHKxn7',
rewards: [
{
commission: null,
lamports: -11967,
postBalance: 1069953,
pubkey: '2a3pkHet7gtAmtiCxYtzsRv2XYn8zNeSn9y4teez4W2N',
rewardType: 'Rent'
},
{
commission: null,
lamports: 5981378,
postBalance: 2438637705015,
pubkey: 'F9EcdNAwmvV7RtD4N9ncoPgMe3coVx2YNkJFWQM5yXgV',
rewardType: 'Fee'
},
]
}
{
'jsonrpc': '2.0',
'result': {
'blockHeight': 130810346,
'blockTime': 1659842826,
'blockhash': '8uVQKzNnEnS7qCi7unau1yQSNmMZx4CtHaLoXwd8wFKX',
'parentSlot': 144901418,
'previousBlockhash': 'CQxyHKyX4h8NNqPiD3dtKuo8nGrJFj2vhcvj4DToCuy2',
'rewards': [{
'commission': None,
'lamports': 4549561,
'postBalance': 68632801237,
'pubkey': 'J4izU5SytdEsvEfotPJxvHMqz2CPkSBGMdQCGgT4XxYP',
'rewardType': 'Fee'}],
'transactions': [{
'meta': {
'err': {'InstructionError': [0, {'Custom': 300}]},
'fee': 6000,
'innerInstructions': [],
'loadedAddresses': {'readonly': [], 'writable': []},
'logMessages': ['Program GDDMwNyyx8uB6zrqwBFHjLLG3TBYk2F8Az4yrQC5RzMp invoke [1]', 'Program log: Sequence out of order | sequence_num=348182 | last_known=348189', 'Program log: Custom program error: 0x12c', 'Program GDDMwNyyx8uB6zrqwBFHjLLG3TBYk2F8Az4yrQC5RzMp consumed 4082 of 300003 compute units', 'Program GDDMwNyyx8uB6zrqwBFHjLLG3TBYk2F8Az4yrQC5RzMp failed: custom program error: 0x12c'],
'postBalances': [3584983662, 457104960, 1392000, 540224312039280, 1825496640, 1224960, 2039280, 2039280, 1003601360, 1440533833240105, 36609600, 1392000, 457104960, 23357760, 30791040, 23357760, 3841920, 42873600, 617665673, 1141440, 3841920, 1, 12083560, 0, 1141440, 2039280, 1141440, 934087680],
'postTokenBalances': [{
'accountIndex': 3, 'mint': 'So11111111111111111111111111111111111111112', 'owner': 'F8Vyqk3unwxkXukZFQeYyGmFfTG3CAX4v24iyrjEYBJV', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '540224300000000', 'decimals': 9, 'uiAmount': 540224.3, 'uiAmountString': '540224.3'}}, {'accountIndex': 6, 'mint': 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'owner': 'F8Vyqk3unwxkXukZFQeYyGmFfTG3CAX4v24iyrjEYBJV', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '20946745145623', 'decimals': 6, 'uiAmount': 20946745.145623, 'uiAmountString': '20946745.145623'}}, {'accountIndex': 7, 'mint': 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'owner': '9BVcYqEQxyccuwznvxXqDkSJFavvTyheiTYk231T1A8S', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '34773873563912', 'decimals': 6, 'uiAmount': 34773873.563912, 'uiAmountString': '34773873.563912'}}, {'accountIndex': 9, 'mint': 'So11111111111111111111111111111111111111112', 'owner': '9BVcYqEQxyccuwznvxXqDkSJFavvTyheiTYk231T1A8S', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '1440533781200825', 'decimals': 9, 'uiAmount': 1440533.781200825, 'uiAmountString': '1440533.781200825'}}, {'accountIndex': 25, 'mint': 'MSRMcoVyrFxnSgo5uXwone5SKcGhT1KEJMFEkMEWf9L', 'owner': '9BVcYqEQxyccuwznvxXqDkSJFavvTyheiTYk231T1A8S', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '1', 'decimals': 0, 'uiAmount': 1.0, 'uiAmountString': '1'}}],
'preBalances': [
3584989662, 457104960, 1392000, 540224312039280, 1825496640, 1224960, 2039280, 2039280, 1003601360, 1440533833240105, 36609600, 1392000, 457104960, 23357760, 30791040, 23357760, 3841920, 42873600, 617665673, 1141440, 3841920, 1, 12083560, 0, 1141440, 2039280, 1141440, 934087680],
'preTokenBalances': [{
'accountIndex': 3, 'mint': 'So11111111111111111111111111111111111111112', 'owner': 'F8Vyqk3unwxkXukZFQeYyGmFfTG3CAX4v24iyrjEYBJV', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '540224300000000', 'decimals': 9, 'uiAmount': 540224.3, 'uiAmountString': '540224.3'}}, {'accountIndex': 6, 'mint': 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'owner': 'F8Vyqk3unwxkXukZFQeYyGmFfTG3CAX4v24iyrjEYBJV', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '20946745145623', 'decimals': 6, 'uiAmount': 20946745.145623, 'uiAmountString': '20946745.145623'}}, {'accountIndex': 7, 'mint': 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'owner': '9BVcYqEQxyccuwznvxXqDkSJFavvTyheiTYk231T1A8S', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '34773873563912', 'decimals': 6, 'uiAmount': 34773873.563912, 'uiAmountString': '34773873.563912'}}, {'accountIndex': 9, 'mint': 'So11111111111111111111111111111111111111112', 'owner': '9BVcYqEQxyccuwznvxXqDkSJFavvTyheiTYk231T1A8S', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '1440533781200825', 'decimals': 9, 'uiAmount': 1440533.781200825, 'uiAmountString': '1440533.781200825'}}, {'accountIndex': 25, 'mint': 'MSRMcoVyrFxnSgo5uXwone5SKcGhT1KEJMFEkMEWf9L', 'owner': '9BVcYqEQxyccuwznvxXqDkSJFavvTyheiTYk231T1A8S', 'programId': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'uiTokenAmount': {'amount': '1', 'decimals': 0, 'uiAmount': 1.0, 'uiAmountString': '1'}}],
'rewards': [],
'status': {
'Err': {
'InstructionError': [0, {'Custom': 300}]}
}
},
'transaction': {
'message': {'accountKeys': ['6xf1PhucG5GfYhmjDj39StTRqRNB4yuGL6jAVxvuvKur', '14ivtgssEBoBjuZJtSAPKYgpUK7DmnSwuPMqJoVTSgKJ', '2bqJYcA1A8gw4qJFjyE2G4akiUunpd9rP6QzfnxHqSqr', '36c6YqAwyGKQG66XEp2dJc5JqjaBNv7sVghEtJv4c7u6', '5KKsLVU6TcbVDK4BS6K1DGDxnh4Q9xjYJ8XaDCG5t8ht', '7i3GdAVqHnpPjG6icBjBi9G22tfPN53jEqhgcMZwbWtq', '8CFo8bL8mZQK8abbFyypFMwEDd8tVJjHTTojMLgQTUSZ', '8Vw25ZackDzaJzzBBqcgcpDsCsDfRSkMGgwFQ3gbReWF', '9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT', 'AVn3JRGhifPCxjxZsU3tQuo4U4dTHizHzBDGW983tx47', 'AZG3tFCFtiCqEwyardENBQNpHqxgzbMw8uKeZEw2nRG5', 'BGcwkj1WudQwUUjFk78hAjwd1uAm8trh1N4CJSa51euh', 'CEQdAFKdycHugujQg9k2wbmxjcpdYZyVLfV9WerTnafJ', 'FgTgGdhMNK6sgMA3vdnNvrhMdg8DnwvCHHJhQ1mSDUE9', 'FnC5WhtCeDbDzv3xXjrVCxUUBmGVA35UkEex1NVGbbV3', '6HBQ7LAwZw5c52RWimnmAhcHfxXM5fBNZ3UfKGLJAPv6', '7jH1uLmiB2zbHNe6juZZYjQCrvquakTwd3yMaQpeP8rR', '98pjRuQjK3qA6gXts96PqZT4Ze5QmnCmt3QYjhbUSPue', '9BVcYqEQxyccuwznvxXqDkSJFavvTyheiTYk231T1A8S', '9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin', 'AMzanZxMirPCgGcBoH9kw4Jzi9LFMomyUCXbpzDeL2T8', 'ComputeBudget111111111111111111111111111111', 'EBDRoayCDDUvDgCimta45ajQeXbexv7aKqJubruqpyvu', 'F8Vyqk3unwxkXukZFQeYyGmFfTG3CAX4v24iyrjEYBJV', 'GDDMwNyyx8uB6zrqwBFHjLLG3TBYk2F8Az4yrQC5RzMp', 'HiB9JtxgnA7G29EWVcPFhXbLCTaPitdVJKgD3BhH6TJj', 'mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'], 'header': {'numReadonlySignedAccounts': 0, 'numReadonlyUnsignedAccounts': 13, 'numRequiredSignatures': 1}, 'instructions': [{'accounts': [5, 0], 'data': 'Bz9KX2mGFbpmacZEqi9RaP', 'programIdIndex': 24}, {'accounts': [], 'data': '1f4kpnp2grDV', 'programIdIndex': 21}, {'accounts': [17, 22, 14, 0, 16, 2, 9, 20, 11, 7, 8, 1, 12, 13, 18, 4, 3, 6, 23, 19, 27], 'data': '8LLYxH7', 'programIdIndex': 26}, {'accounts': [17, 14, 0, 22, 19, 8, 1, 12, 10, 4, 3, 6, 16, 2, 9, 20, 11, 7, 27, 18, 23, 25, 13, 15], 'data': 'Ndbz1ftxy1HDJrDcL6bkWGVMK3Hih83BAcGpxgrU3AbBNgjYgwuXezhpPMuhkcNHAyz1NiKVktjvh4j', 'programIdIndex': 26}, {'accounts': [17, 14, 0, 22, 19, 8, 1, 12, 10, 4, 3, 6, 16, 2, 9, 20, 11, 7, 27, 18, 23, 25, 13, 15], 'data': 'Ndbz1fyeC6639Yxr4Y2yfU9NMpMQ6hHxw2oNAUcd7zfTr9VTrtCS6CQ1BX2oNVgTQP8etS6qvNWqy2w', 'programIdIndex': 26}], 'recentBlockhash': '7uvUirfJm4nRNQquiH77E5e1uYXnGxRvq3vqYHUqnUPV'},
'signatures': ['gEfw75sCXbwMhJCq6nJRDXkVnEVYc4YuaRqy5pEqLaaWgUrVixqi3NnammVGc4KCDuewaCaaYpkMTYBtz35qBuP']
}
}
},
'id': 1,
}
Transaction Structure
Transactions are quite different from those on other blockchains. Be sure to review Anatomy of a Transaction to learn about transactions on Solana.
The JSON structure of a transaction is defined as follows:
signatures: <array[string]>
- A list of base-58 encoded signatures applied to the transaction. The list is always of lengthmessage.header.numRequiredSignatures
and not empty. The signature at indexi
corresponds to the public key at indexi
inmessage.account_keys
. The first one is used as the transaction id.message: <object>
- Defines the content of the transaction.accountKeys: <array[string]>
- List of base-58 encoded public keys used by the transaction, including by the instructions and for signatures. The firstmessage.header.numRequiredSignatures
public keys must sign the transaction.header: <object>
- Details the account types and signatures required by the transaction.numRequiredSignatures: <number>
- The total number of signatures required to make the transaction valid. The signatures must match the firstnumRequiredSignatures
ofmessage.account_keys
.numReadonlySignedAccounts: <number>
- The lastnumReadonlySignedAccounts
of the signed keys are read-only accounts. Programs may process multiple transactions that load read-only accounts within a single PoH entry, but are not permitted to credit or debit lamports or modify account data. Transactions targeting the same read-write account are evaluated sequentially.numReadonlyUnsignedAccounts: <number>
- The lastnumReadonlyUnsignedAccounts
of the unsigned keys are read-only accounts.
recentBlockhash: <string>
- A base-58 encoded hash of a recent block in the ledger used to prevent transaction duplication and to give transactions lifetimes.instructions: <array[object]>
- List of program instructions that will be executed in sequence and committed in one atomic transaction if all succeed.programIdIndex: <number>
- Index into themessage.accountKeys
array indicating the program account that executes this instruction.accounts: <array[number]>
- List of ordered indices into themessage.accountKeys
array indicating which accounts to pass to the program.data: <string>
- The program input data encoded in a base-58 string.
addressTableLookups: <array[object] or undefined>
- List of address table lookups used by a transaction to dynamically load addresses from on-chain address lookup tables. Undefined ifmaxSupportedTransactionVersion
is not set.accountKey: <string>
- base-58 encoded public key for an address lookup table account.writableIndexes: <array[number]>
- List of indices used to load addresses of writable accounts from a lookup table.readonlyIndexes: <array[number]>
- List of indices used to load addresses of readonly accounts from a lookup table.
Inner Instructions Structure
The Solana runtime records the cross-program instructions that are invoked during transaction processing and makes these available for greater transparency of what was executed on-chain per transaction instruction. Invoked instructions are grouped by the originating transaction instruction and are listed in order of processing.
The JSON structure of inner instructions is defined as a list of objects in the following structure:
index: number
- Index of the transaction instruction from which the inner instruction(s) originatedinstructions: <array[object]>
- Ordered list of inner program instructions that were invoked during a single transaction instruction.programIdIndex: <number>
- Index into themessage.accountKeys
array indicating the program account that executes this instruction.accounts: <array[number]>
- List of ordered indices into themessage.accountKeys
array indicating which accounts to pass to the program.data: <string>
- The program input data encoded in a base-58 string.
Token Balances Structure
The JSON structure of token balances is defined as a list of objects in the following structure:
accountIndex: <number>
- Index of the account in which the token balance is provided for.mint: <string>
- Pubkey of the token's mint.owner: <string or undefined>
- Pubkey of token balance's owner.programId: <string or undefined>
- Pubkey of the Token program that owns the account.uiTokenAmount: <object>
-amount: <string>
- Raw amount of tokens as a string, ignoring decimals.decimals: <number>
- Number of decimals configured for token's mint.uiAmount: <number or null>
- Token amount as a float, accounting for decimals. DEPRECATEDuiAmountString: <string>
- Token amount as a string, accounting for decimals.
getBlockHeight
Returns the current block height of the node
Parameters:
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
<u64>
- Current block height
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev/ -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getBlockHeight"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getBlockHeight(94101948));
})();
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getBlockHeight"))
print(response.json())
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": 1233,
"id": 1
}
127628270
{
'jsonrpc': '2.0',
'result': 131272827,
'id': 2
}
getBlockProduction
Returns recent block production information from the current or previous epoch.
Parameters:
<object>
- (optional) Configuration object containing the following optional fields:- (optional) Commitment
- (optional)
range: <object>
- Slot range to return block production for. If parameter not provided, defaults to current epoch.firstSlot: <u64>
- first slot to return block production information for (inclusive)- (optional)
lastSlot: <u64>
- last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot
- (optional)
identity: <string>
- Only return results for this validator identity (base-58 encoded)
Results:
The result will be an RpcResponse JSON object with value
equal to:
<object>
byIdentity: <object>
- a dictionary of validator identities, as base-58 encoded strings. Value is a two element array containing the number of leader slots and the number of blocks produced.range: <object>
- Block production slot rangefirstSlot: <u64>
- first slot of the block production information (inclusive)lastSlot: <u64>
- last slot of block production information (inclusive)
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getBlockProduction"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getBlockHeight(94101948));
})();
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getBlockProduction"))
parsed = parse(response.json())
if isinstance(parsed, Ok):
print(parsed.result)
else:
logging.error(parsed.message)
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 9887
},
"value": {
"byIdentity": {
"85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr": [9888, 9886]
},
"range": {
"firstSlot": 0,
"lastSlot": 9887
}
}
},
"id": 1
}
{
{
{
DLcLbyBao4PGF4Y5tziugEie4HLwKoMeH3MAsCJ1rM7j: [Array],
DMJ6YN8JVm9DeUuBTVycu7VQ1Jzob7b4RpjGz3jwFyME: [Array],
...
},
range: { firstSlot: 141264000, lastSlot: 141303509 }
}
}
{
'jsonrpc': '2.0',
'result': {
'context': {
'apiVersion': '1.10.34',
'slot': 145418576
},
'value': {
'byIdentity': {
'11NXupFrmqj6SuZxkP1HsfkNw9aKnnkgbHqXx9QHNmj': [12, 12],
...
}
'range': {
'firstSlot': 145152000,
'lastSlot': 145418576
}
}
},
'id': 1
}
getBlockCommitment
Returns commitment for particular block
Parameters:
<u64>
- block, identified by Slot
Results:
The result field will be a JSON object containing:
commitment
- commitment, comprising either:<null>
- Unknown block<array>
- commitment, array of u64 integers logging the amount of cluster stake in lamports that has voted on the block at each depth from 0 toMAX_LOCKOUT_HISTORY
+ 1
totalStake
- total active stake, in lamports, of the current epoch
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getBlockCommitment","params":[5]}
'
not currently available through solanaJS
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_block_commitment(94101948) )
Response:
- Curl
- Solana-py
{
"jsonrpc": "2.0",
"result": {
"commitment": [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 10, 32
],
"totalStake": 42
},
"id": 1
}
{'jsonrpc': '2.0', 'result': {'commitment': None, 'totalStake': 401158976900869437}, 'id': 1}
getBlocks
Returns a list of confirmed blocks between two slots
Parameters:
<u64>
- start_slot, as u64 integer<u64>
- (optional) end_slot, as u64 integer (must be no more than 500,000 blocks higher than thestart_slot
)- (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
Results:
The result field will be an array of u64 integers listing confirmed blocks
between start_slot
and either end_slot
, if provided, or latest confirmed block,
inclusive. Max range allowed is 500,000 slots.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc": "2.0","id":1,"method":"getBlocks","params":[141140588, 141140598]}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getBlocks(141140588, 141140598));
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_blocks(141140588, 141140598))
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":[141140589,141140590,141140591,141140596,141140597,141140598],"id":1}
[141140589,141140590,141140591,141140596,141140597,141140598]
{"jsonrpc":"2.0","result":[141140589,141140590,141140591,141140596,141140597,141140598],"id":1}
getBlocksWithLimit
Returns a list of confirmed blocks starting at the given slot
Parameters:
<u64>
- start_slot, as u64 integer<u64>
- limit, as u64 integer (must be no more than 500,000 blocks higher than thestart_slot
)- (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
Results:
The result field will be an array of u64 integers listing confirmed blocks
starting at start_slot
for up to limit
blocks, inclusive.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc": "2.0","id":1,"method":"getBlocksWithLimit","params":[5, 3]}
'
not currently available through solanaJS
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev",json=request("getBlocksWithLimit", params=[5,3]))
parsed = parse(response.json())
if isinstance(parsed, Ok):
print(parsed.result)
else:
logging.error(parsed.message)
Response:
- Curl
- Solana-py
{"jsonrpc":"2.0","result":[141110588,141110589,141110590],"id":1}
[144991546, 144991547, 144991552]
getBlockTime
Returns the estimated production time of a block.
Each validator reports their UTC time to the ledger on a regular interval by intermittently adding a timestamp to a Vote for a particular block. A requested block's time is calculated from the stake-weighted mean of the Vote timestamps in a set of recent blocks recorded on the ledger.
Parameters:
<u64>
- block, identified by Slot
Results:
<i64>
- estimated production time, as Unix timestamp (seconds since the Unix epoch)<null>
- timestamp is not available for this block
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getBlockTime","params":[141140588]}
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getBlockTime(144992082));
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_block_time(144992082))
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":1657540704,"id":1}
1657647978
{'jsonrpc': '2.0', 'result': 1659894567, 'id': 1}
getClusterNodes
Returns information about all the nodes participating in the cluster
Parameters:
None
Results:
The result field will be an array of JSON objects, each with the following sub fields:
pubkey: <string>
- Node public key, as base-58 encoded stringgossip: <string | null>
- Gossip network address for the nodetpu: <string | null>
- TPU network address for the noderpc: <string | null>
- JSON RPC network address for the node, ornull
if the JSON RPC service is not enabledversion: <string | null>
- The software version of the node, ornull
if the version information is not availablefeatureSet: <u32 | null >
- The unique identifier of the node's feature setshredVersion: <u16 | null>
- The shred version the node has been configured to use
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getClusterNodes"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getClusterNodes());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_cluster_nodes())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":[{"featureSet":965221688,"gossip":"158.101.111.162:8000","pubkey":"FTYXLjp9cacLQeE1pXWQvTX8UAUFFiYi7YJJmsEmoFGc","rpc":"158.101.111.162:8899","shredVersion":51382,"tpu":"158.101.111.162:8003","version":"1.10.25"},
...]
}
[
{
featureSet: 965221688,
gossip: '158.101.111.162:8000',
pubkey: 'FTYXLjp9cacLQeE1pXWQvTX8UAUFFiYi7YJJmsEmoFGc',
rpc: '158.101.111.162:8899',
shredVersion: 51382,
tpu: '158.101.111.162:8003',
version: '1.10.25'
},
{
featureSet: 1425680972,
gossip: '141.95.157.84:8000',
pubkey: 'DqvbkPV2sCGMgHCy9byMQ1s9VJueNsGMuNYtexwdCaQh',
rpc: null,
shredVersion: 51382,
tpu: '141.95.157.84:8003',
version: '1.10.29'
},
...
]
{'jsonrpc': '2.0', 'result': [{'featureSet': 483097211, 'gossip': '193.122.139.128:8000', 'pubkey': 'Gm6WxcBkgLwupuiypU3ZRjyZmg3MF372bvNsgueTdBUb', 'rpc': '193.122.139.128:8899', 'shredVersion': 51382, 'tpu': '193.122.139.128:8003', 'version': '1.10.34'},]
...
}
getEpochInfo
Returns information about the current epoch
Parameters:
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result field will be an object with the following fields:
absoluteSlot: <u64>
, the current slotblockHeight: <u64>
, the current block heightepoch: <u64>
, the current epochslotIndex: <u64>
, the current slot relative to the start of the current epochslotsInEpoch: <u64>
, the number of slots in this epochtransactionCount: <u64 | null>
, total number of transactions processed without error since genesis
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getEpochInfo());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_epoch_info())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"absoluteSlot":141165563,"blockHeight":127509031,"epoch":326,"slotIndex":333563,"slotsInEpoch":432000,"transactionCount":83873626329},"id":1}
{
absoluteSlot: 141304576,
blockHeight: 127629249,
epoch: 327,
slotIndex: 40576,
slotsInEpoch: 432000,
transactionCount: 84093062260
}
{'jsonrpc': '2.0', 'result': {'absoluteSlot': 145211017, 'blockHeight': 131091407, 'epoch': 336, 'slotIndex': 59017, 'slotsInEpoch': 432000, 'transactionCount': 90041982061}, 'id': 1}
getEpochSchedule
Returns epoch schedule information from this cluster's genesis config
Parameters:
None
Results:
The result field will be an object with the following fields:
slotsPerEpoch: <u64>
, the maximum number of slots in each epochleaderScheduleSlotOffset: <u64>
, the number of slots before beginning of an epoch to calculate a leader schedule for that epochwarmup: <bool>
, whether epochs start short and growfirstNormalEpoch: <u64>
, first normal-length epoch, log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH)firstNormalSlot: <u64>
, MINIMUM_SLOTS_PER_EPOCH * (2.pow(firstNormalEpoch) - 1)
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getEpochSchedule"} '
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getEpochschedule());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_epoch_schedule())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"firstNormalEpoch":0,"firstNormalSlot":0,"leaderScheduleSlotOffset":432000,"slotsPerEpoch":432000,"warmup":false},"id":1}
{
slotsPerEpoch: 432000,
leaderScheduleSlotOffset: 432000,
warmup: false,
firstNormalEpoch: 0,
firstNormalSlot: 0
}
{'jsonrpc': '2.0', 'result': {'firstNormalEpoch': 0, 'firstNormalSlot': 0, 'leaderScheduleSlotOffset': 432000, 'slotsPerEpoch': 432000, 'warmup': False}, 'id': 1}
getFeeForMessage
NEW: This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8
Get the fee the network will charge for a particular Message
Parameters:
message: <string>
- Base-64 encoded Message<object>
- (optional) Commitment (used for retrieving blockhash)
Results:
<u64 | null>
- Fee corresponding to the message at the specified blockhash
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getFeeForMessage",
"params":[
"AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA",
{
"commitment":"processed"
}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
const YOUR_TRANSACTION = new Transaction();
const YOUR_MESSAGE = YOUR_TRANSACTION.compileMessage();
console.log(await solana.getFeeForMessage(YOUR_MESSAGE));
})();
from solana.rpc.api import Client
from solana.keypair import Keypair
from solana.system_program import TransferParams, transfer
from solana.transaction import Transaction
sender, receiver = Keypair.from_seed(bytes(PublicKey(1))), Keypair.from_seed(bytes(PublicKey(2)))
txn = Transaction().add(transfer(TransferParams(from_pubkey=sender.public_key, to_pubkey=receiver.public_key, lamports=1000)))
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_fee_for_message(txn.compile_message()))
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": { "context": { "slot": 5068 }, "value": 5000 },
"id": 1
}
{ context: { apiVersion: '1.10.25', slot: 141304577 }, value: 5002 }
{ context: { apiVersion: '1.10.25', slot: 141304577 }, value: 5002 }
getFirstAvailableBlock
Returns the slot of the lowest confirmed block that has not been purged from the ledger
Parameters:
None
Results:
<u64>
- Slot
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getFirstAvailableBlock"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getFirstAvailableBlock());
})();
from solana.rpc.api import Client
print(solana_client.get_first_available_block())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":141114071,"id":1}
141252286
{'jsonrpc': '2.0', 'result': 144995280, 'id': 2}
getGenesisHash
Returns the genesis hash
Parameters:
None
Results:
<string>
- a Hash as base-58 encoded string
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getGenesisHash"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getGenesisHash());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_genesis_hash() )
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",
"id": 1
}
5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d
{'jsonrpc': '2.0', 'result': '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d', 'id': 1}
getHealth
Returns the current health of the node.
If one or more --known-validator
arguments are provided to
solana-validator
, "ok" is returned when the node has within
HEALTH_CHECK_SLOT_DISTANCE
slots of the highest known validator, otherwise
an error is returned. "ok" is always returned if no known validators are
provided.
Parameters:
None
Results:
If the node is healthy: "ok" If the node is unhealthy, a JSON RPC error response is returned. The specifics of the error response are UNSTABLE and may change in the future
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getHealth"}
'
not currently available through solanaJS
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getHealth"))
parsed = parse(response.json())
if isinstance(parsed, Ok):
print(parsed.result)
else:
logging.error(parsed.message)
Response:
- Curl
- Solana-py
{"jsonrpc":"2.0","result":"ok","id":1}
ok
getHighestSnapshotSlot
NEW: This method is only available in solana-core v1.9 or newer. Please use getSnapshotSlot for solana-core v1.8
Returns the highest slot information that the node has snapshots for.
This will find the highest full snapshot slot, and the highest incremental snapshot slot based on the full snapshot slot, if there is one.
Parameters:
None
Results:
<object>
full: <u64>
- Highest full snapshot slotincremental: <u64 | undefined>
- Highest incremental snapshot slot based onfull
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1,"method":"getHighestSnapshotSlot"}
'
// not currently available through solanaJS
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getHighestSnapshotSlot"))
parsed = parse(response.json())
if isinstance(parsed, Ok):
print(parsed.result)
else:
logging.error(parsed.message)
Response:
- Curl
- Solana-py
{ "jsonrpc": "2.0", "result": { "full": 100, "incremental": 110 }, "id": 1 }
{'jsonrpc': '2.0', 'result': {'full': 145419687, 'incremental': 145424072}, 'id': 1}
getIdentity
Returns the identity pubkey for the current node
Parameters:
None
Results:
The result field will be a JSON object with the following fields:
identity
, the identity pubkey of the current node (as a base-58 encoded string)
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getIdentity"}
'
// not currently available through solanaJS
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_identity())
Response:
- Curl
- Solana-py
{"jsonrpc":"2.0","result":{"identity":"FTYXLjp9cacLQeE1pXWQvTX8UAUFFiYi7YJJmsEmoFGc"},"id":1}
{'jsonrpc': '2.0', 'result': {'identity': 'Gm6WxcBkgLwupuiypU3ZRjyZmg3MF372bvNsgueTdBUb'}, 'id': 1}
getInflationGovernor
Returns the current inflation governor
Parameters:
<object>
- (optional) Commitment
Results:
The result field will be a JSON object with the following fields:
initial: <f64>
, the initial inflation percentage from time 0terminal: <f64>
, terminal inflation percentagetaper: <f64>
, rate per year at which inflation is lowered. Rate reduction is derived using the target slot time in genesis configfoundation: <f64>
, percentage of total inflation allocated to the foundationfoundationTerm: <f64>
, duration of foundation pool inflation in years
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getInflationGovernor"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getInflationGovernor());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_inflation_governor())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"foundation":0.0,"foundationTerm":0.0,"initial":0.08,"taper":0.15,"terminal":0.015},"id":1}
{
foundation: 0,
foundationTerm: 0,
initial: 0.08,
taper: 0.15,
terminal: 0.015
}
{'jsonrpc': '2.0', 'result': {'foundation': 0.0, 'foundationTerm': 0.0, 'initial': 0.08, 'taper': 0.15, 'terminal': 0.015}, 'id': 1}
getInflationRate
Returns the specific inflation values for the current epoch
Parameters:
None
Results:
The result field will be a JSON object with the following fields:
total: <f64>
, total inflationvalidator: <f64>
, inflation allocated to validatorsfoundation: <f64>
, inflation allocated to the foundationepoch: <u64>
, epoch for which these values are valid
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getInflationRate"}
'
// not currently available through solanaJS
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_inflation_rate())
Response:
- Curl
- Solana-py
{"jsonrpc":"2.0","result":{"epoch":326,"foundation":0.0,"total":0.06834101217540162,"validator":0.06834101217540162},"id":1}
{'jsonrpc': '2.0', 'result': {'epoch': 336, 'foundation': 0.0, 'total': 0.06773552716811244, 'validator': 0.06773552716811244}, 'id': 1}
getInflationReward
Returns the inflation / staking reward for a list of addresses for an epoch
Parameters:
<array>
- An array of addresses to query, as base-58 encoded strings<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
epoch: <u64>
- An epoch for which the reward occurs. If omitted, the previous epoch will be used - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results
The result field will be a JSON array with the following fields:
epoch: <u64>
, epoch for which reward occuredeffectiveSlot: <u64>
, the slot in which the rewards are effectiveamount: <u64>
, reward amount in lamportspostBalance: <u64>
, post balance of the account in lamportscommission: <u8|undefined>
- vote account commission when the reward was credited
Example
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getInflationReward",
"params": [
["6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu", "BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"], {"epoch": 2}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const pubkey1 = new web3.PublicKey("YOUR_ADDRESS_1");
const pubkey2 = new web3.PublicKey("YOUR_ADDRESS_2");
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getInflationReward([pubkey1, pubkey2]));
})();
import requests
import json
url = "https://demo2YQc882ZJDpQzeveFNFPpaDW.xyz2.hyperplane.dev"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "getInflationReward",
"params": [
['myaddress'], , {"epoch": 2}
]
}
response = requests.post(url, json=payload).json()
print(response)
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": [
{
"amount": 2500,
"effectiveSlot": 224,
"epoch": 2,
"postBalance": 499999442500
},
null
],
"id": 1
}
{
"jsonrpc": "2.0",
"result": [
{
"amount": 2500,
"effectiveSlot": 224,
"epoch": 2,
"postBalance": 499999442500
},
null
],
"id": 1
}
{
"jsonrpc": "2.0",
"result": [
{
"amount": 2500,
"effectiveSlot": 224,
"epoch": 2,
"postBalance": 499999442500
},
null
],
"id": 1
}
getLargestAccounts
Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours)
Parameters:
<object>
- (optional) Configuration object containing the following optional fields:- (optional) Commitment
- (optional)
filter: <string>
- filter results by account type; currently supported:circulating|nonCirculating
Results:
The result will be an RpcResponse JSON object with value
equal to an array of:
<object>
- otherwise, a JSON object containing:address: <string>
, base-58 encoded address of the accountlamports: <u64>
, number of lamports in the account, as a u64
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getLargestAccounts"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getLargestAccounts());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_largest_accounts())
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 54
},
"value": [
{
"lamports": 999974,
"address": "99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ"
},
{
"lamports": 42,
"address": "uPwWLo16MVehpyWqsLkK3Ka8nLowWvAHbBChqv2FZeL"
},
...
]
},
"id": 1
}
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 54
},
"value": [
{
"lamports": 999974,
"address": "99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ"
},
{
"lamports": 42,
"address": "uPwWLo16MVehpyWqsLkK3Ka8nLowWvAHbBChqv2FZeL"
},
...
]
},
"id": 1
}
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 54
},
"value": [
{
"lamports": 999974,
"address": "99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ"
},
{
"lamports": 42,
"address": "uPwWLo16MVehpyWqsLkK3Ka8nLowWvAHbBChqv2FZeL"
},
...
]
},
"id": 1
}
getLatestBlockhash
NEW: This method is only available in solana-core v1.9 or newer. Please use getRecentBlockhash for solana-core v1.8
Returns the latest blockhash
Parameters:
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment (used for retrieving blockhash) - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
RpcResponse<object>
- RpcResponse JSON object withvalue
field set to a JSON object including:blockhash: <string>
- a Hash as base-58 encoded stringlastValidBlockHeight: <u64>
- last block height at which the blockhash will be valid
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method": "getLatestBlockhash",
"params":[
{
"commitment":"processed"
}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getLatestBlockhash());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_latest_blockhash())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141170143},"value":{"blockhash":"5mmBjUejiF8KRST17XGtFtQEmQgmxyhm73X74R6cr9ap","lastValidBlockHeight":127513190}},"id":1}
{
blockhash: 'AhqzHoLuin7dKPGcmxywTREXHv3UM8GTU74iEnULnYab',
lastValidBlockHeight: 127630024
}
{'jsonrpc': '2.0', 'result': {'context': {'apiVersion': '1.10.34', 'slot': 145279554}, 'value': {'blockhash': 'EAoKxBaZLrpAf9DEBk3cdMvg8KdcKBmTqKbsG6DKBTEm', 'lastValidBlockHeight': 131152356}}, 'id': 1}
getLeaderSchedule
Returns the leader schedule for an epoch
Parameters:
<u64>
- (optional) Fetch the leader schedule for the epoch that corresponds to the provided slot. If unspecified, the leader schedule for the current epoch is fetched<object>
- (optional) Configuration object containing the following field:- (optional) Commitment
- (optional)
identity: <string>
- Only return results for this validator identity (base-58 encoded)
Results:
<null>
- if requested epoch is not found<object>
- otherwise, the result field will be a dictionary of validator identities, as base-58 encoded strings, and their corresponding leader slot indices as values (indices are relative to the first slot in the requested epoch)
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method": "getLeaderSchedule"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getLeaderSchedule());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_leader_schedule())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"12CUDzb3oe8RBQ4tYGqsuPsCbsVE4KWfktXRihXf8Ggq":[1976,1977,1978,1979,5100,5101,5102,5103
...
]
},
"id": 1
}
0, 9931, 11164, 11165, 11166, 11167, 11272, 11273, 11274, 11275, 11884, 11885,...
{"jsonrpc":"2.0","result":{"12CUDzb3oe8RBQ4tYGqsuPsCbsVE4KWfktXRihXf8Ggq":[1976,1977,1978,1979,5100,5101,5102,5103
...
]
},
"id": 1
}
getMaxRetransmitSlot
Get the max slot seen from retransmit stage.
Results:
<u64>
- Slot
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method": "getMaxRetransmitSlot"}
'
// not currently available through solanaJS
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getMaxRetransmitSlot"))
print(response.json())
Response:
- Curl
- Solana-py
{"jsonrpc":"2.0","result":141170576,"id":1}
{"jsonrpc":"2.0","result":141170576,"id":1}
getMaxShredInsertSlot
Get the max slot seen from after shred insert.
Results:
<u64>
- Slot
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method": "getMaxShredInsertSlot"}
'
// not currently available through solanaJS
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getMaxShredInsertSlot"))
print(response.json())
Response:
- Curl
- Solana-py
{"jsonrpc":"2.0","result":141170916,"id":1}
{'jsonrpc': '2.0', 'result': 145280409, 'id': 5}
getMinimumBalanceForRentExemption
Returns minimum balance required to make account rent exempt.
Parameters:
<usize>
- account data length<object>
- (optional) Commitment
Results:
<u64>
- minimum lamports required in account
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getMinimumBalanceForRentExemption", "params":[50]}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getMinimumBalanceForRentExemption(50));
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_minimum_balance_for_rent_exemption(50) )
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":1238880,"id":1}
{"jsonrpc":"2.0","result":1238880,"id":1}
{'jsonrpc': '2.0', 'result': 1238880, 'id': 1}
getMultipleAccounts
Returns the account information for a list of Pubkeys.
Parameters:
<array>
- An array of Pubkeys to query, as base-58 encoded strings (up to a maximum of 100).<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
encoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedata
field is type<string>
. - (optional)
dataSlice: <object>
- limit the returned account data using the providedoffset: <usize>
andlength: <usize>
fields; only available for "base58", "base64" or "base64+zstd" encodings. - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result will be an RpcResponse JSON object with value
equal to:
An array of:
<null>
- if the account at that Pubkey doesn't exist<object>
- otherwise, a JSON object containing:lamports: <u64>
, number of lamports assigned to this account, as a u64owner: <string>
, base-58 encoded Pubkey of the program this account has been assigned todata: <[string, encoding]|object>
, data associated with the account, either as encoded binary data or JSON format{<program>: <state>}
, depending on encoding parameterexecutable: <bool>
, boolean indicating if the account contains a program (and is strictly read-only)rentEpoch: <u64>
, the epoch at which this account will next owe rent, as u64
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getMultipleAccounts",
"params": [
[
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
],
{
"dataSlice": {
"offset": 0,
"length": 0
}
}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const publicKey = new web3.PublicKey(
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
);
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
const publicKey2 = new web3.PublicKey(
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
);
console.log(await solana.getMultipleAccountsInfo([publicKey, publicKey2]));
})();
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getMultipleAccounts", params=[["vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg","4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"],{"dataSlice": {"offset": 0,"length": 0}}]))
print(response.json())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141171200},"value":[{"data":["","base64"],"executable":false,"lamports":407413255,"owner":"11111111111111111111111111111111","rentEpoch":326},{"data":["","base64"],"executable":false,"lamports":2000000,"owner":"11111111111111111111111111111111","rentEpoch":326}]},"id":1}
[
{
data: <Buffer >,
executable: false,
lamports: 1451511165738,
owner: PublicKey { _bn: <BN: 0> },
rentEpoch: 327
},
{
data: <Buffer 01 00 00 00 a2 b3 17 b5 27 21 bc 13 a9 36 6d 86 aa d5 80 5a b6 46 44 98 6c eb 97 e0 a2 2e 46 46 79 90 18 8c 72 02 54 45 d9 b6 8f c8 4f 83 c6 eb 07 e0 ... 3681 more bytes>,
executable: false,
lamports: 71948948215833,
owner: PublicKey {
_bn: <BN: 761481d357474bb7c4d7624ebd3bdb3d8355e73d11043fc0da3538000000000>
},
rentEpoch: 327
}
]
{'jsonrpc': '2.0', 'result': {'context': {'apiVersion': '1.10.34', 'slot': 145281504}, 'value': [{'data': ['', 'base64'], 'executable': False, 'lamports': 407413255, 'owner': '11111111111111111111111111111111', 'rentEpoch': 336}, {'data': ['', 'base64'], 'executable': False, 'lamports': 2000000, 'owner': '11111111111111111111111111111111', 'rentEpoch': 336}]}, 'id': 2}
getProgramAccounts
Returns all accounts owned by the provided program Pubkey
Parameters:
<string>
- Pubkey of program, as base-58 encoded string<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
encoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedata
field is type<string>
. - (optional)
dataSlice: <object>
- limit the returned account data using the providedoffset: <usize>
andlength: <usize>
fields; only available for "base58", "base64" or "base64+zstd" encodings. - (optional)
filters: <array>
- filter results using up to 4 filter objects; account must meet all filter criteria to be included in results - (optional)
withContext: bool
- wrap the result in an RpcResponse JSON object. - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Filters:
memcmp: <object>
- compares a provided series of bytes with program account data at a particular offset. Fields:offset: <usize>
- offset into program account data to start comparisonbytes: <string>
- data to match, as encoded stringencoding: <string>
- encoding for filterbytes
data, either "base58" or "base64". Data is limited in size to 128 or fewer decoded bytes. NEW: This field, and base64 support generally, is only available in solana-core v1.11.5 or newer. Please omit when querying nodes on earlier versions
dataSize: <u64>
- compares the program account data length with the provided data size
Results:
By default the result field will be an array of JSON objects. If withContext
flag is set the array will be wrapped in an RpcResponse JSON object.
The array will contain:
pubkey: <string>
- the account Pubkey as base-58 encoded stringaccount: <object>
- a JSON object, with the following sub fields:lamports: <u64>
, number of lamports assigned to this account, as a u64owner: <string>
, base-58 encoded Pubkey of the program this account has been assigned todata: <[string,encoding]|object>
, data associated with the account, either as encoded binary data or JSON format{<program>: <state>}
, depending on encoding parameterexecutable: <bool>
, boolean indicating if the account contains a program (and is strictly read-only)rentEpoch: <u64>
, the epoch at which this account will next owe rent, as u64
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0", "id":1, "method":"getProgramAccounts", "params":["4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T"]}
'
const web3 = require("@solana/web3.js");
(async () => {
const url = "https://your-endpoint.hyperplane.dev";
const solana = new web3.Connection(url);
console.log(
await solana.getProgramAccounts(new web3.PublicKey("YOUR_PROGRAM_ADDRESS"))
);
})();
from solana.rpc.api import Client
print(solana_client.get_program_accounts("YOUR_PROGRAM_ADDRESS"))
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": [
{
"account": {
"data": "2R9jLfiAQ9bgdcw6h8s44439",
"executable": false,
"lamports": 15298080,
"owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"rentEpoch": 28
},
"pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"
}
],
"id": 1
}
{
"jsonrpc": "2.0",
"result": [
{
"account": {
"data": "2R9jLfiAQ9bgdcw6h8s44439",
"executable": false,
"lamports": 15298080,
"owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"rentEpoch": 28
},
"pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"
}
],
"id": 1
}
{
"jsonrpc": "2.0",
"result": [
{
"account": {
"data": "2R9jLfiAQ9bgdcw6h8s44439",
"executable": false,
"lamports": 15298080,
"owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"rentEpoch": 28
},
"pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"
}
],
"id": 1
}
getRecentPerformanceSamples
Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and include the number of transactions and slots that occur in a given time window.
Parameters:
limit: <usize>
- (optional) number of samples to return (maximum 720)
Results:
An array of:
RpcPerfSample<object>
slot: <u64>
- Slot in which sample was taken atnumTransactions: <u64>
- Number of transactions in samplenumSlots: <u64>
- Number of slots in samplesamplePeriodSecs: <u16>
- Number of seconds in a sample window
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getRecentPerformanceSamples", "params": [4]}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getRecentPerformanceSamples(4));
})();
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getRecentPerformanceSamples", params=(4)))
parsed = parse(response.json())
if isinstance(parsed, Ok):
print(parsed.result)
else:
logging.error(parsed.message)
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":[{"numSlots":85,"numTransactions":128754,"samplePeriodSecs":60,"slot":141171680},{"numSlots":83,"numTransactions":104989,"samplePeriodSecs":60,"slot":141171595},{"numSlots":76,"numTransactions":111917,"samplePeriodSecs":60,"slot":141171512},{"numSlots":78,"numTransactions":106120,"samplePeriodSecs":60,"slot":141171436}],"id":1}
{"jsonrpc":"2.0","result":[{"numSlots":85,"numTransactions":128754,"samplePeriodSecs":60,"slot":141171680},{"numSlots":83,"numTransactions":104989,"samplePeriodSecs":60,"slot":141171595},{"numSlots":76,"numTransactions":111917,"samplePeriodSecs":60,"slot":141171512},{"numSlots":78,"numTransactions":106120,"samplePeriodSecs":60,"slot":141171436}],"id":1}
{"jsonrpc":"2.0","result":[{"numSlots":85,"numTransactions":128754,"samplePeriodSecs":60,"slot":141171680},{"numSlots":83,"numTransactions":104989,"samplePeriodSecs":60,"slot":141171595},{"numSlots":76,"numTransactions":111917,"samplePeriodSecs":60,"slot":141171512},{"numSlots":78,"numTransactions":106120,"samplePeriodSecs":60,"slot":141171436}],"id":1}
getSignaturesForAddress
Returns signatures for confirmed transactions that include the given address in
their accountKeys
list. Returns signatures backwards in time from the
provided signature or most recent confirmed block
Parameters:
<string>
- account address as base-58 encoded string<object>
- (optional) Configuration object containing the following fields:- (optional)
limit: <number>
- maximum transaction signatures to return (between 1 and 1,000, default: 1,000). - (optional)
before: <string>
- start searching backwards from this transaction signature. If not provided the search starts from the top of the highest max confirmed block. - (optional)
until: <string>
- search until this transaction signature, if found before limit reached. - (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result field will be an array of transaction signature information, ordered from newest to oldest transaction:
<object>
signature: <string>
- transaction signature as base-58 encoded stringslot: <u64>
- The slot that contains the block with the transactionerr: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionsmemo: <string |null>
- Memo associated with the transaction, null if no memo is presentblockTime: <i64 | null>
- estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
note
The RPC method is web3 getSignaturesForAddress
whereas the Web3 method uses confirmedSignaturesForAddress2
as the equivalent method.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSignaturesForAddress",
"params": [
"Vote111111111111111111111111111111111111111",
{
"limit": 1
}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const publicKey = new web3.PublicKey(
"Vote111111111111111111111111111111111111111"
);
const solana = new web3.Connection("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/");
console.log(await solana.getConfirmedSignaturesForAddress2(publicKey));
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_signatures_for_address("Vote111111111111111111111111111111111111111", limit=1))
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":[{"blockTime":1657561498,"confirmationStatus":"finalized","err":null,"memo":null,"signature":"67fCjk6rFBrXH8AVLLWWPVpsQvvgfYR6tNHfEyxodUrRFW1NKccWigyunfocLHAuc8LWS4K74pHZ1syLLEUfnEPn","slot":141171699}],"id":1}
[
{
blockTime: 1657648307,
confirmationStatus: 'confirmed',
err: null,
memo: null,
signature: '4i3RFD9ssyufk7RWNHSaqWbqNrx9F94BecnXxUgRzAdEwy7EYwDNwAcXmwqVDqZDqR9AAkhfRYJ32rFxLWHsdSqe',
slot: 141304575
},
{
blockTime: 1657648307,
confirmationStatus: 'confirmed',
err: null,
memo: null,
signature: '3Q8ycLBEsCyxMMUd17szE6QMimVsbTmoDuiGwJL6c2218F4u9tfFdv9VvRU2LyrSTe1tgR7ECc41FAwb3Wdm1diu',
slot: 141304575
},
...
]
{'jsonrpc': '2.0', 'result': [{'blockTime': 1660164648, 'confirmationStatus': 'finalized', 'err': None, 'memo': None, 'signature': '66wfz2GBgc2QwJLSt1GzQNF1upL1Tggp6SYky7o2dkdwRbBYje6QcdQMoyWz7rNm8ipu7zYuWQ39sxp1iVzwce4u', 'slot': 145433491}], 'id': 1}
getSignatureStatuses
Returns the statuses of a list of signatures. Unless the
searchTransactionHistory
configuration parameter is included, this method only
searches the recent status cache of signatures, which retains statuses for all
active slots plus MAX_RECENT_BLOCKHASHES
rooted slots.
Parameters:
<array>
- An array of transaction signatures to confirm, as base-58 encoded strings (up to a maximum of 256)<object>
- (optional) Configuration object containing the following field:searchTransactionHistory: <bool>
- if true, a Solana node will search its ledger cache for any signatures not found in the recent status cache
Results:
An RpcResponse containing a JSON object consisting of an array of TransactionStatus objects.
RpcResponse<object>
- RpcResponse JSON object withvalue
field:
An array of:
<null>
- Unknown transaction<object>
slot: <u64>
- The slot the transaction was processedconfirmations: <usize | null>
- Number of blocks since signature confirmation, null if rooted, as well as finalized by a supermajority of the clustererr: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionsconfirmationStatus: <string | null>
- The transaction's cluster confirmation status; eitherprocessed
,confirmed
, orfinalized
. See Commitment for more on optimistic confirmation.- DEPRECATED:
status: <object>
- Transaction status"Ok": <null>
- Transaction was successful"Err": <ERR>
- Transaction failed with TransactionError
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getSignatureStatuses",
"params": [
[
"5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
"5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7"
]
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const accountOne =
"5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS";
const accountTwo =
"D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff";
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(
await solana.getSignatureStatuses([accountOne, accountTwo], {
searchTransactionHistory: true,
})
);
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
signatures = [
"5tGfZLNDxtCtWsW1BJoeTyHvnfGqpADDfBkUgkKENQJ8iz5yTN3ae51j8m8GRFevJx82gyuKnEX7iexFsqf7X2vS",
"D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"
]
print(solana_client.get_signature_statuses(signatures,search_transaction_history=true))
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 82
},
"value": [
{
"slot": 72,
"confirmations": 10,
"err": null,
"status": {
"Ok": null
},
"confirmationStatus": "confirmed"
},
null
]
},
"id": 1
}
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 82
},
"value": [
{
"slot": 72,
"confirmations": 10,
"err": null,
"status": {
"Ok": null
},
"confirmationStatus": "confirmed"
},
null
]
},
"id": 1
}
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 82
},
"value": [
{
"slot": 72,
"confirmations": 10,
"err": null,
"status": {
"Ok": null
},
"confirmationStatus": "confirmed"
},
null
]
},
"id": 1
}
getSlot
Returns the slot that has reached the given or default commitment level
Parameters:
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
<u64>
- Current slot
Example:
Requests:
- Curl
- Web3
- Solana-py
url https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSlot"}
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getSlot());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_slot())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":141173252,"id":1}
{"jsonrpc":"2.0","result":141173252,"id":1}
{"jsonrpc":"2.0","result":141173252,"id":1}
getSlotLeader
Returns the current slot leader
Parameters:
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
<string>
- Node identity Pubkey as base-58 encoded string
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSlotLeader"}
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getSlotLeader());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_slot_leader())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":"EgxVyTgh2Msg781wt9EsqYx4fW8wSvfFAHGLaJQjghiL","id":1}
B3KmR1pjxxxdzdAbVpbw7UHxoznFG17Gi3fVwjdGdxip
{"jsonrpc":"2.0","result":"EgxVyTgh2Msg781wt9EsqYx4fW8wSvfFAHGLaJQjghiL","id":1}
getSlotLeaders
Returns the slot leaders for a given slot range
Parameters:
<u64>
- Start slot, as u64 integer<u64>
- Limit, as u64 integer (between 1 and 5,000)
Results:
<array[string]>
- Node identity public keys as base-58 encoded strings
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSlotLeaders", "params":[141173252, 10]}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getSlotLeaders(140630426, 10));
})();
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getSlotLeaders", params=(140630426, 10)))
parsed = parse(response.json())
if isinstance(parsed, Ok):
print(parsed.result)
else:
logging.error(parsed.message)
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":["Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","CYkkaM5KwoxaFtZcximkm1DFYnABdiUUUvJg1WURDRsh","CYkkaM5KwoxaFtZcximkm1DFYnABdiUUUvJg1WURDRsh"],"id":1}
[
PublicKey {
_bn: <BN: fc5a45107cb3eaa5f4af9a484a0c1dbdad9528567e263016f8e10e02fb132b00>
},
PublicKey {
_bn: <BN: fc5a45107cb3eaa5f4af9a484a0c1dbdad9528567e263016f8e10e02fb132b00>
},
PublicKey {
_bn: <BN: 7d5256544b232df6f898e7ee4b2b3b6467e5d2f6f7f8ff8d58cc2fe2d8ce6dc5>
},
PublicKey {
_bn: <BN: 7d5256544b232df6f898e7ee4b2b3b6467e5d2f6f7f8ff8d58cc2fe2d8ce6dc5>
},
PublicKey {
_bn: <BN: 7d5256544b232df6f898e7ee4b2b3b6467e5d2f6f7f8ff8d58cc2fe2d8ce6dc5>
}
]
{"jsonrpc":"2.0","result":["Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","Bx7SNaHfyeLZDeja9HPsn61XYjeForHtrTxLCb6cu62o","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","GCTFK7PkLHcM2ku59Subj461b1STBaLGXuDM74rBaroi","CYkkaM5KwoxaFtZcximkm1DFYnABdiUUUvJg1WURDRsh","CYkkaM5KwoxaFtZcximkm1DFYnABdiUUUvJg1WURDRsh"],"id":1}
getStakeActivation
Returns epoch activation information for a stake account
Parameters:
<string>
- Pubkey of stake account to query, as base-58 encoded string<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
epoch: <u64>
- epoch for which to calculate activation details. If parameter not provided, defaults to current epoch. - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result will be a JSON object with the following fields:
state: <string
- the stake account's activation state, one of:active
,inactive
,activating
,deactivating
active: <u64>
- stake active during the epochinactive: <u64>
- stake inactive during the epoch
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getStakeActivation", "params": ["CYRJWqiSjLitBAcRxPvWpgX3s5TvmN2SuRY3eEYypFvT"]}
'
const web3 = require("@solana/web3.js");
(async () => {
const stakeKey = new web3.PublicKey(
"Buc3N8TitzhVtvy7sm85YWpY2F5PAAKV2iLP1cZAbwrJ"
);
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getStakeActivation(stakeKey));
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_stake_activation("Buc3N8TitzhVtvy7sm85YWpY2F5PAAKV2iLP1cZAbwrJ"))
Response:
- Curl
- Web3
- Solana-py
{
"jsonrpc": "2.0",
"result": { "active": 197717120, "inactive": 0, "state": "active" },
"id": 1
}
{
"jsonrpc": "2.0",
"result": { "active": 197717120, "inactive": 0, "state": "active" },
"id": 1
}
{
"jsonrpc": "2.0",
"result": { "active": 197717120, "inactive": 0, "state": "active" },
"id": 1
}
getSupply
Returns information about the current supply.
Parameters:
<object>
- (optional) Configuration object containing the following optional fields:- (optional) Commitment
- (optional)
excludeNonCirculatingAccountsList: <bool>
- exclude non circulating accounts list from response
Results:
The result will be an RpcResponse JSON object with value
equal to a JSON object containing:
total: <u64>
- Total supply in lamportscirculating: <u64>
- Circulating supply in lamportsnonCirculating: <u64>
- Non-circulating supply in lamportsnonCirculatingAccounts: <array>
- an array of account addresses of non-circulating accounts, as strings. IfexcludeNonCirculatingAccountsList
is enabled, the returned array will be empty.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0", "id":1, "method":"getSupply"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getSupply());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_supply())
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141174771},"value":{"circulating":345442137740647355,"nonCirculating":179232152518799659,"nonCirculatingAccounts":["621uN8yYE1MrCxGdunAqMuCW3iSL7a2P58BGjhHThTH",
...
],"total":524674290259447014}},"id":1}
{
context: { apiVersion: '1.10.25', slot: 141307543 },
value: {
circulating: 345574952255964740,
nonCirculating: 179294868802958080,
nonCirculatingAccounts: [
[PublicKey], [PublicKey], [PublicKey], [PublicKey], [PublicKey],
...
],
total: 524869821058922800
}
}
{
context: { apiVersion: '1.10.25', slot: 141307543 },
value: {
circulating: 345574952255964740,
nonCirculating: 179294868802958080,
nonCirculatingAccounts: [
[PublicKey], [PublicKey], [PublicKey], [PublicKey], [PublicKey],
...
],
total: 524869821058922800
}
}
getTokenAccountBalance
Returns the token balance of an SPL Token account.
Parameters:
<string>
- Pubkey of Token account to query, as base-58 encoded string<object>
- (optional) Commitment
Results:
The result will be an RpcResponse JSON object with value
equal to a JSON object containing:
amount: <string>
- the raw balance without decimals, a string representation of u64decimals: <u8>
- number of base 10 digits to the right of the decimal placeuiAmount: <number | null>
- the balance, using mint-prescribed decimals DEPRECATEDuiAmountString: <string>
- the balance as a string, using mint-prescribed decimals
For more details on returned data: The Token Balances Structure response from getBlock follows a similar structure.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getTokenAccountBalance", "params": ["6kRT2kAVsBThd5cz6gaQtomaBwLxSp672RoRPGizikH4"]}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(
await solana.getTokenAccountBalance(
new web3.PublicKey("DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN")
)
);
})();
from solana.rpc.api import Client
from solana.publickey import PublicKey
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_token_account_balance(PublicKey("DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN")))
Response:
- Curl
- Web3
- Solana-py
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141175172},"value":{"amount":"2877185985235536","decimals":9,"uiAmount":2877185.985235536,"uiAmountString":"2877185.985235536"}},"id":1}
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141175172},"value":{"amount":"2877185985235536","decimals":9,"uiAmount":2877185.985235536,"uiAmountString":"2877185.985235536"}},"id":1}
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141175172},"value":{"amount":"2877185985235536","decimals":9,"uiAmount":2877185.985235536,"uiAmountString":"2877185.985235536"}},"id":1}
getTokenAccountsByDelegate
Returns all SPL Token accounts by approved Delegate.
Parameters:
<string>
- Pubkey of account delegate to query, as base-58 encoded string<object>
- Either:mint: <string>
- Pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; orprogramId: <string>
- Pubkey of the Token program that owns the accounts, as base-58 encoded string
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
encoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedata
field is type<string>
. - (optional)
dataSlice: <object>
- limit the returned account data using the providedoffset: <usize>
andlength: <usize>
fields; only available for "base58", "base64" or "base64+zstd" encodings. - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result will be an RpcResponse JSON object with value
equal to an array of JSON objects, which will contain:
pubkey: <string>
- the account Pubkey as base-58 encoded stringaccount: <object>
- a JSON object, with the following sub fields:lamports: <u64>
, number of lamports assigned to this account, as a u64owner: <string>
, base-58 encoded Pubkey of the program this account has been assigned todata: <object>
, Token state data associated with the account, either as encoded binary data or in JSON format{<program>: <state>}
executable: <bool>
, boolean indicating if the account contains a program (and is strictly read-only)rentEpoch: <u64>
, the epoch at which this account will next owe rent, as u64
When the data is requested with the jsonParsed
encoding a format similar to that of the Token Balances Structure can be expected inside the structure, both for the tokenAmount
and the delegatedAmount
, with the latter being an optional object.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByDelegate",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed"
}
]
}
'
// not currently supported by solanaJS
const axios = require("axios");
(() => {
const config = {
headers: {
"Content-Type": "application/json",
},
};
const data = {
jsonrpc: "2.0",
id: 1,
method: "getTokenAccountsByDelegate",
params: [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
programId: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
},
{
encoding: "jsonParsed",
},
],
};
axios
.post("https://your-endpoint.hyperplane.dev", data, config)
.then(function (response) {
// handle success
console.log(response.data);
})
.catch((err) => {
// handle error
console.log(err);
});
})();
from solana.rpc.api import Client
from solana.publickey import PublicKey
from solana.rpc.types import TokenAccountOpts
solana_client = Client("https://your-endpoint.hyperplane.dev")
pub_key = PublicKey("5z1qMNWupMpbXp89tHPp9P6mdWY8o8ACUNwgu6Ef6xNn")
token_acc = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
print(solana_client.get_token_accounts_by_delegate(pub_key,TokenAccountOpts(program_id=token_acc)))
Response:
- Curl
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"account": {
"data": {
"program": "spl-token",
"parsed": {
"info": {
"tokenAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"state": "initialized",
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
"owner": "CnPoSPKXu7wJqxe59Fs72tkBeALovhsCxYeFwPCQH9TD"
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 4
},
"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp"
}
]
},
"id": 1
}
getTokenAccountsByOwner
Returns all SPL Token accounts by token owner.
Parameters:
<string>
- Pubkey of account owner to query, as base-58 encoded string<object>
- Either:mint: <string>
- Pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; orprogramId: <string>
- Pubkey of the Token program that owns the accounts, as base-58 encoded string
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
encoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using Zstandard and base64-encodes the result. "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when thedata
field is type<string>
. - (optional)
dataSlice: <object>
- limit the returned account data using the providedoffset: <usize>
andlength: <usize>
fields; only available for "base58", "base64" or "base64+zstd" encodings. - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result will be an RpcResponse JSON object with value
equal to an array of JSON objects, which will contain:
pubkey: <string>
- the account Pubkey as base-58 encoded stringaccount: <object>
- a JSON object, with the following sub fields:lamports: <u64>
, number of lamports assigned to this account, as a u64owner: <string>
, base-58 encoded Pubkey of the program this account has been assigned todata: <object>
, Token state data associated with the account, either as encoded binary data or in JSON format{<program>: <state>}
executable: <bool>
, boolean indicating if the account contains a program (and is strictly read-only)rentEpoch: <u64>
, the epoch at which this account will next owe rent, as u64
When the data is requested with the jsonParsed
encoding a format similar to that of the Token Balances Structure can be expected inside the structure, both for the tokenAmount
and the delegatedAmount
, with the latter being an optional object.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F",
{
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"
},
{
"encoding": "jsonParsed"
}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
const accountPublicKey = new web3.PublicKey(
"GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa"
);
const mintAccount = new web3.PublicKey(
"1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"
);
console.log(
await solana.getTokenAccountsByOwner(accountPublicKey, {
mint: mintAccount,
})
);
})();
from solana.rpc.api import Client
from solana.publickey import PublicKey
from solana.rpc.types import TokenAccountOpts
solana_client = Client("https://your-endpoint.hyperplane.dev")
pub_key = PublicKey("GgPpTKg78vmzgDtP1DNn72CHAYjRdKY7AV6zgszoHCSa")
mint_account = "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"
print(solana_client.get_token_accounts_by_owner(pub_key,TokenAccountOpts(mint=mint_account)))
Response:
- Curl
- Web3
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"account": {
"data": {
"program": "spl-token",
"parsed": {
"accountType": "account",
"info": {
"tokenAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"state": "initialized",
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
"owner": "4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F"
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 4
},
"pubkey": "C2gJg6tKpQs41PRS1nC8aw3ZKNZK3HQQZGVrDFDup5nx"
}
]
},
"id": 1
}
{ apiVersion: '1.10.29', slot: 141308183 },
value: [
{ account: [Object], pubkey: [PublicKey] },
{ account: [Object], pubkey: [PublicKey] },
{ account: [Object], pubkey: [PublicKey] },
...
]
}
getTokenLargestAccounts
Returns the 20 largest accounts of a particular SPL Token type.
Parameters:
<string>
- Pubkey of token Mint to query, as base-58 encoded string<object>
- (optional) Commitment
Results:
The result will be an RpcResponse JSON object with value
equal to an array of JSON objects containing:
address: <string>
- the address of the token accountamount: <string>
- the raw token account balance without decimals, a string representation of u64decimals: <u8>
- number of base 10 digits to the right of the decimal placeuiAmount: <number | null>
- the token account balance, using mint-prescribed decimals DEPRECATEDuiAmountString: <string>
- the token account balance as a string, using mint-prescribed decimals
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0", "id":1, "method":"getTokenLargestAccounts", "params": ["3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"]}
'
const web3 = require("@solana/web3.js");
(async () => {
const url = "https://your-endpoint.hyperplane.dev";
const solana = new web3.Connection(url);
console.log(
await solana.getTokenLargestAccounts(
new web3.PublicKey("1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE")
)
);
})();
from solana.rpc.api import Client
from solana.publickey import PublicKey
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_token_largest_accounts(PublicKey("1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE")))
Response:
- Curl
- Web3
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"address": "FYjHNoFtSQ5uijKrZFyYAxvEr87hsKXkXcxkcmkBAf4r",
"amount": "771",
"decimals": 2,
"uiAmount": 7.71,
"uiAmountString": "7.71"
},
{
"address": "BnsywxTcaYeNUtzrPxQUvzAWxfzZe3ZLUJ4wMMuLESnu",
"amount": "229",
"decimals": 2,
"uiAmount": 2.29,
"uiAmountString": "2.29"
}
]
},
"id": 1
}
{
context: { apiVersion: '1.10.29', slot: 141308183 },
value: [
{
address: [PublicKey],
amount: '1',
decimals: 0,
uiAmount: 1,
uiAmountString: '1'
},
{
address: [PublicKey],
amount: '0',
decimals: 0,
uiAmount: 0,
uiAmountString: '0'
},
{
address: [PublicKey],
amount: '0',
decimals: 0,
uiAmount: 0,
uiAmountString: '0'
}
]
}
getTokenSupply
Returns the total supply of an SPL Token type.
Parameters:
<string>
- Pubkey of token Mint to query, as base-58 encoded string<object>
- (optional) Commitment
Results:
The result will be an RpcResponse JSON object with value
equal to a JSON object containing:
amount: <string>
- the raw total token supply without decimals, a string representation of u64decimals: <u8>
- number of base 10 digits to the right of the decimal placeuiAmount: <number | null>
- the total token supply, using mint-prescribed decimals DEPRECATEDuiAmountString: <string>
- the total token supply as a string, using mint-prescribed decimals
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getTokenSupply", "params": ["BKY3nztnk29ugvyMXtFyXVDvUp4uenUt9oBC6bMq97yA"]}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(
await solana.getTokenSupply(
new web3.PublicKey("7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU")
)
);
})();
from jsonrpcclient import request, parse, Ok
import logging
import requests
response = requests.post("https://your-endpoint.hyperplane.dev", json=request("getTokenSupply", params=(["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"])))
parsed = parse(response.json())
if isinstance(parsed, Ok):
print(parsed.result)
else:
logging.error(parsed.message)
Response:
- Curl
- Web3
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141179260},"value":{"amount":"1","decimals":0,"uiAmount":1.0,"uiAmountString":"1"}},"id":1}
{
context: { apiVersion: '1.10.29', slot: 141308183 },
value: { amount: '1', decimals: 0, uiAmount: 1, uiAmountString: '1' }
}
getTransaction
Returns transaction details for a confirmed transaction
Parameters:
<string>
- transaction signature as base-58 encoded string<object>
- (optional) Configuration object containing the following optional fields:- (optional)
encoding: <string>
- encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". "jsonParsed" encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in thetransaction.message.instructions
list. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts
,data
, andprogramIdIndex
fields). - (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
- (optional)
maxSupportedTransactionVersion: <number>
- set the max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and any versioned transaction will prompt the error.
- (optional)
Results:
<null>
- if transaction is not found or not confirmed<object>
- if transaction is confirmed, an object with the following fields:slot: <u64>
- the slot this transaction was processed intransaction: <object|[string,encoding]>
- Transaction object, either in JSON format or encoded binary data, depending on encoding parameterblockTime: <i64 | null>
- estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not availablemeta: <object | null>
- transaction status metadata object:err: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionsfee: <u64>
- fee this transaction was charged, as u64 integerpreBalances: <array>
- array of u64 account balances from before the transaction was processedpostBalances: <array>
- array of u64 account balances after the transaction was processedinnerInstructions: <array|null>
- List of inner instructions ornull
if inner instruction recording was not enabled during this transactionpreTokenBalances: <array|undefined>
- List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transactionpostTokenBalances: <array|undefined>
- List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transactionlogMessages: <array|null>
- array of string log messages ornull
if log message recording was not enabled during this transaction- DEPRECATED:
status: <object>
- Transaction status"Ok": <null>
- Transaction was successful"Err": <ERR>
- Transaction failed with TransactionError
rewards: <array>
- present if rewards are requested; an array of JSON objects containing:pubkey: <string>
- The public key, as base-58 encoded string, of the account that received the rewardlamports: <i64>
- number of reward lamports credited or debited by the account, as a i64postBalance: <u64>
- account balance in lamports after the reward was appliedrewardType: <string>
- type of reward: currently only "rent", other types may be added in the futurecommission: <u8|undefined>
- vote account commission when the reward was credited, only present for voting and staking rewards
loadedAddresses: <object|undefined>
- Transaction addresses loaded from address lookup tables. Undefined ifmaxSupportedTransactionVersion
is not set in request params.writable: <array[string]>
- Ordered list of base-58 encoded addresses for writable loaded accountsreadonly: <array[string]>
- Ordered list of base-58 encoded addresses for readonly loaded accounts
version: <"legacy"|number|undefined>
- Transaction version. Undefined ifmaxSupportedTransactionVersion
is not set in request params.
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
"json"
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(
await solana.getTransaction(
"D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"
)
);
})();
# get_confirmed_transaction is similar to get_transaction. Get_transaction is not currently supported.
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_transaction("D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"))
Response:
- Curl
- Web3
{
"jsonrpc": "2.0",
"result": {
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"slot": 430,
"transaction": {
"message": {
"accountKeys": [
"3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
"AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
"SysvarS1otHashes111111111111111111111111111",
"SysvarC1ock11111111111111111111111111111111",
"Vote111111111111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 3,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [1, 2, 3, 0],
"data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
"programIdIndex": 4
}
],
"recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
},
"signatures": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
]
}
},
"blockTime": null,
"id": 1
}
{
blockTime: 1657651029,
meta: {
err: { InstructionError: [Array] },
fee: 5000,
innerInstructions: null,
loadedAddresses: { readonly: [], writable: [] },
logMessages: null,
postBalances: [ 407773440000, 49054080, 46773482880, 1141440, 0, 1141440 ],
postTokenBalances: [],
preBalances: [ 407773445000, 49054080, 46773482880, 1141440, 0, 1141440 ],
preTokenBalances: [],
rewards: [],
status: { Err: [Object] }
},
slot: 141308558,
transaction: {
message: Message {
header: [Object],
accountKeys: [Array],
recentBlockhash: 'Dmdi8Dyirga1tnCEX55ZhxGhrXUBnTGg5vDVKyD5T9fp',
instructions: [Array],
indexToProgramIds: [Map]
},
signatures: [
'jfpC1eM2DsFdSAVvbWqSDdfzXe9KSQwYVRMbELR9wHeLXoMaCiobBVQwdTvLXzawQJCemnpb4nVfQofHfXFu7Dz'
]
}
}
getTransactionCount
Returns the current Transaction count from the ledger
Parameters:
<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
<u64>
- count
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getTransactionCount());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_transaction_count())
Response:
- Curl
- Web3
{"jsonrpc":"2.0","result":83893853003,"id":1}
84099050641
getVersion
Returns the current solana versions running on the node
Parameters:
None
Results:
The result field will be a JSON object with the following fields:
solana-core
, software version of solana-corefeature-set
, unique identifier of the current software's feature set
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getVersion"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getVersion());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_version())
Response:
- Curl
- Web3
{"jsonrpc":"2.0","result":{"feature-set":965221688,"solana-core":"1.10.25"},"id":1}
{ 'feature-set': 1425680972, 'solana-core': '1.10.29' }
getVoteAccounts
Returns the account info and associated stake for all the voting accounts in the current bank.
Parameters:
<object>
- (optional) Configuration object containing the following field:- (optional) Commitment
- (optional)
votePubkey: <string>
- Only return results for this validator vote address (base-58 encoded) - (optional)
keepUnstakedDelinquents: <bool>
- Do not filter out delinquent validators with no stake - (optional)
delinquentSlotDistance: <u64>
- Specify the number of slots behind the tip that a validator must fall to be considered delinquent. NOTE: For the sake of consistency between ecosystem products, it is not recommended that this argument be specified.
Results:
The result field will be a JSON object of current
and delinquent
accounts,
each containing an array of JSON objects with the following sub fields:
votePubkey: <string>
- Vote account address, as base-58 encoded stringnodePubkey: <string>
- Validator identity, as base-58 encoded stringactivatedStake: <u64>
- the stake, in lamports, delegated to this vote account and active in this epochepochVoteAccount: <bool>
- bool, whether the vote account is staked for this epochcommission: <number>
, percentage (0-100) of rewards payout owed to the vote accountlastVote: <u64>
- Most recent slot voted on by this vote accountepochCredits: <array>
- History of how many credits earned by the end of each epoch, as an array of arrays containing:[epoch, credits, previousCredits]
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getVoteAccounts"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getVoteAccounts());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_vote_accounts())
Response:
- Curl
- Web3
{"jsonrpc":"2.0","result":{"current":[{"activatedStake":85118457714249,"commission":10,"epochCredits":[[322,41843389,41495091],[323,42179219,41843389],[324,42502720,42179219],[325,42832749,42502720],[326,43122414,42832749]],"epochVoteAccount":true,"lastVote":141180375,"nodePubkey":"J2obR2DK7gnd6H88HjKzEYuMyboDWRNpbzwmGSh31nnu","rootSlot":141180321,"votePubkey":"DXv73X82WCjVMsqDszK3z764tTJMU3nPXyCU3UktudBG"},
...
"id":1,
}
rootSlot: 135986328,
votePubkey: '7oX5QSP9yBjT1F1sRSDCX91ZxibETqemDM4WLDju5rTM'
},
{
activatedStake: 606733653285,
commission: 2,
epochCredits: [Array],
epochVoteAccount: true,
lastVote: 102136951,
nodePubkey: '5bBECyn9rNvcTB8y9j2Rzs3myXUDR97m62oaJong8sg2',
rootSlot: 102136920,
votePubkey: '5BTgeYMDUQz59sdNFr47FVmA119QmsoZNjUyGyeGb4sJ'
},
...
]
}
isBlockhashValid
NEW: This method is only available in solana-core v1.9 or newer. Please use getFeeCalculatorForBlockhash for solana-core v1.8
Returns whether a blockhash is still valid or not
Parameters:
blockhash: <string>
- the blockhash of this block, as base-58 encoded string<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment (used for retrieving blockhash) - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
<bool>
- True if the blockhash is still valid
Example:
Requests:
- Curl
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"isBlockhashValid",
"params":[
"J7rBdM6AecPDEZp8aPq5iPSNKVkU5Q76F3oAV4eW5wsW",
{"commitment":"processed"}
]
}
'
Response:
- Curl
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.10.25","slot":141180617},"value":false},"id":1}
minimumLedgerSlot
Returns the lowest slot that the node has information about in its ledger. This value may increase over time if the node is configured to purge older ledger data
Parameters:
None
Results:
u64
- Minimum ledger slot
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"minimumLedgerSlot"}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
console.log(await solana.getMinimumLedgerSlot());
})();
from solana.rpc.api import Client
solana_client = Client("https://your-endpoint.hyperplane.dev")
print(solana_client.get_minimum_ledger_slot())
Response:
- Curl
- Web3
{"jsonrpc":"2.0","result":141126254,"id":1}
141253289
requestAirdrop
Requests an airdrop of lamports to a Pubkey
Parameters:
<string>
- Pubkey of account to receive lamports, as base-58 encoded string<integer>
- lamports, as a u64<object>
- (optional) Commitment (used for retrieving blockhash and verifying airdrop success)
Results:
<string>
- Transaction Signature of airdrop, as base-58 encoded string
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"requestAirdrop", "params":["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", 1000000000]}
'
const web3 = require("@solana/web3.js");
(async () => {
const url = "https://your-endpoint.hyperplane.dev";
const solana = new web3.Connection(url);
console.log(
await solana.requestAirdrop(
new web3.PublicKey("YOUR_WALLET_ADDRESS"),
1000000000
)
);
})();
from solana.rpc.api import Client
from solana.publickey import PublicKey
print(solana_client.request_airdrop(PublicKey("YOUR_WALLET_ADDRESS"), 1000000000))
Response:
- Curl
{
"jsonrpc": "2.0",
"result": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
"id": 1
}
sendTransaction
Submits a signed transaction to the cluster for processing.
This method does not alter the transaction in any way; it relays the transaction created by clients to the node as-is.
If the node's rpc service receives the transaction, this method immediately succeeds, without waiting for any confirmations. A successful response from this method does not guarantee the transaction is processed or confirmed by the cluster.
While the rpc service will reasonably retry to submit it, the transaction
could be rejected if transaction's recent_blockhash
expires before it lands.
Use getSignatureStatuses
to ensure
a transaction is processed and confirmed.
Before submitting, the following preflight checks are performed:
- The transaction signatures are verified
- The transaction is simulated against the bank slot specified by the preflight commitment. On failure an error will be returned. Preflight checks may be disabled if desired. It is recommended to specify the same commitment and preflight commitment to avoid confusing behavior.
The returned signature is the first signature in the transaction, which is used to identify the transaction (transaction id). This identifier can be easily extracted from the transaction data before submission.
Parameters:
<string>
- fully-signed Transaction, as encoded string<object>
- (optional) Configuration object containing the following field:skipPreflight: <bool>
- if true, skip the preflight transaction checks (default: false)preflightCommitment: <string>
- (optional) Commitment level to use for preflight (default:"finalized"
).encoding: <string>
- (optional) Encoding used for the transaction data. Either"base58"
(slow, DEPRECATED), or"base64"
. (default:"base58"
).maxRetries: <usize>
- (optional) Maximum number of times for the RPC node to retry sending the transaction to the leader. If this parameter not provided, the RPC node will retry the transaction until it is finalized or until the blockhash expires.- (optional)
minContextSlot: <number>
- set the minimum slot at which to perform preflight transaction checks.
Results:
<string>
- First Transaction Signature embedded in the transaction, as base-58 encoded string (transaction id)
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "sendTransaction",
"params": [
"4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
// Replace fromWallet with your public/secret keypair, wallet must have funds to pay transaction fees.
const fromWallet = web3.Keypair.generate();
const toWallet = web3.Keypair.generate();
const transaction = new web3.Transaction().add(
web3.SystemProgram.transfer({
fromPubkey: fromWallet.publicKey,
toPubkey: toWallet.publicKey,
lamports: web3.LAMPORTS_PER_SOL / 100,
})
);
console.log(await solana.sendTransaction(transaction, [fromWallet]));
})();
from solana.rpc.api import Client
from solana.account import Account
from solana.system_program import TransferParams, transfer
from solana.transaction import Transaction
#Make sure to paste sender, reciever addresses and public key.
solana_client = Client("https://your-endpoint.hyperplane.dev")
sender, reciever = Account(1), Account(2)
json_request = solana_client.get_recent_blockhash()
recent_blockhash = json_request["result"]["value"]["blockhash"]
txn = Transaction(fee_payer=sender.public_key(), recent_blockhash=recent_blockhash)
txn.add(
transfer(
TransferParams(
from_pubkey=sender.public_key(),
to_pubkey=reciever.public_key(),
lamports=1000
)
)
)
txn.sign(sender)
print(solana_client.send_transaction(txn, sender))
Response:
- Curl
{
"jsonrpc": "2.0",
"result": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb",
"id": 1
}
simulateTransaction
Simulate sending a transaction
Parameters:
<string>
- Transaction, as an encoded string. The transaction must have a valid blockhash, but is not required to be signed.<object>
- (optional) Configuration object containing the following fields:sigVerify: <bool>
- if true the transaction signatures will be verified (default: false, conflicts withreplaceRecentBlockhash
)commitment: <string>
- (optional) Commitment level to simulate the transaction at (default:"finalized"
).encoding: <string>
- (optional) Encoding used for the transaction data. Either"base58"
(slow, DEPRECATED), or"base64"
. (default:"base58"
).replaceRecentBlockhash: <bool>
- (optional) if true the transaction recent blockhash will be replaced with the most recent blockhash. (default: false, conflicts withsigVerify
)accounts: <object>
- (optional) Accounts configuration object containing the following fields:encoding: <string>
- (optional) encoding for returned Account data, either "base64" (default), "base64+zstd" or "jsonParsed". "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to binary encoding, detectable when thedata
field is type<string>
.addresses: <array>
- An array of accounts to return, as base-58 encoded strings
- (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
Results:
An RpcResponse containing a TransactionStatus object
The result will be an RpcResponse JSON object with value
set to a JSON object with the following fields:
err: <object | string | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionslogs: <array | null>
- Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)accounts: <array | null>
- array of accounts with the same length as theaccounts.addresses
array in the request<null>
- if the account doesn't exist or iferr
is not null<object>
- otherwise, a JSON object containing:lamports: <u64>
, number of lamports assigned to this account, as a u64owner: <string>
, base-58 encoded Pubkey of the program this account has been assigned todata: <[string, encoding]|object>
, data associated with the account, either as encoded binary data or JSON format{<program>: <state>}
, depending on encoding parameterexecutable: <bool>
, boolean indicating if the account contains a program (and is strictly read-only)rentEpoch: <u64>
, the epoch at which this account will next owe rent, as u64
unitsConsumed: <u64 | undefined>
, The number of compute budget units consumed during the processing of this transactionreturnData: <object | null>
- the most-recent return data generated by an instruction in the transaction, with the following fields:programId: <string>
, the program that generated the return data, as base-58 encoded Pubkeydata: <[string, encoding]>
, the return data itself, as base-64 encoded binary data
Example:
Requests:
- Curl
- Web3
- Solana-py
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "simulateTransaction",
"params": [
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=",
{
"encoding":"base64",
}
]
}
'
const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://your-endpoint.hyperplane.dev");
// Replace with your public/secret keypair, wallet must have funds to pay transaction fees.
const fromWallet = web3.Keypair.generate();
const toWallet = web3.Keypair.generate();
const transaction = new web3.Transaction().add(
web3.SystemProgram.transfer({
fromPubkey: fromWallet.publicKey,
toPubkey: toWallet.publicKey,
lamports: web3.LAMPORTS_PER_SOL / 100,
})
);
console.log(await solana.simulateTransaction(transaction, [fromWallet]));
})();
from solana.rpc.api import Client
from solana.account import Account
from solana.system_program import TransferParams, transfer
from solana.transaction import Transaction
#Make sure to paste sender, reciever addresses and public key.
solana_client = Client("https://your-endpoint.hyperplane.dev")
sender, reciever = Account(1), Account(2)
json_request = solana_client.get_recent_blockhash()
recent_blockhash = json_request["result"]["value"]["blockhash"]
txn = Transaction(fee_payer=sender.public_key(), recent_blockhash=recent_blockhash)
txn.add(
transfer(
TransferParams(
from_pubkey=sender.public_key(),
to_pubkey=reciever.public_key(),
lamports=1000
)
)
)
txn.sign(sender)
print(solana_client.simulate_transaction(txn))
Response:
- Curl
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 218
},
"value": {
"err": null,
"accounts": null,
"logs": [
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri invoke [1]",
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri consumed 2366 of 1400000 compute units",
"Program return: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri KgAAAAAAAAA=",
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
],
"returnData": {
"data": [
"Kg==",
"base64"
],
"programId": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
},
"unitsConsumed": 2366
}
},
"id": 1
}
Subscription Websocket
After connecting to the RPC PubSub websocket at ws://<ADDRESS>/
:
- Submit subscription requests to the websocket using the methods below
- Multiple subscriptions may be active at once
- Many subscriptions take the optional
commitment
parameter, defining how finalized a change should be to trigger a notification. For subscriptions, if commitment is unspecified, the default value is"finalized"
.
accountSubscribe
Subscribe to an account to receive notifications when the lamports or data for a given account public key changes
Parameters:
<string>
- account Pubkey, as base-58 encoded string<object>
- (optional) Configuration object containing the following optional fields:<object>
- (optional) Commitmentencoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd" or "jsonParsed". "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to binary encoding, detectable when thedata
field is type<string>
.
Results:
<number>
- Subscription id (needed to unsubscribe)
Example:
Requests:
- wscat
- Web3
- Solana-py
wscat -c wss://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \
# wait for connection
{"id":1,"jsonrpc":"2.0","method":"accountSubscribe","params":["E645TckHQnDcavVv92Etc6xSWQaq8zzPtPRGBheviRAk",{"encoding": "jsonParsed"}]}
const web3 = require("@solana/web3.js");
(async () => {
const publicKey = new web3.PublicKey(
"E645TckHQnDcavVv92Etc6xSWQaq8zzPtPRGBheviRAk"
);
const solanaConnection = new web3.Connection("https://your-endpoint.hyperplane.dev", {
wsEndpoint: "wss://sample-endpoint-name.network.quiknode.pro/token-goes-here/",
});
solanaConnection.onAccountChange(
publicKey,
(updatedAccountInfo, context) =>
console.log("Updated account info: ", updatedAccountInfo),
"confirmed"
);
})();
import solana
import asyncio
from asyncstdlib import enumerate
from solana.rpc.websocket_api import connect
from solana.publickey import PublicKey
async def main():
async with connect("wss://sample-endpoint-name.network.quiknode.pro/token-goes-here/") as websocket:
await websocket.account_subscribe(PublicKey('E645TckHQnDcavVv92Etc6xSWQaq8zzPtPRGBheviRAk'))
first_resp = await websocket.recv()
subscription_id = first_resp.result
async for idx, msg in enumerate(websocket):
print(msg)
asyncio.run(main())
Response:
- wscat
{ "jsonrpc": "2.0", "result": 23784, "id": 1 }
Notification Format:
The notification format is the same as seen in the getAccountInfo RPC HTTP method.
Base58 encoding:
{
"jsonrpc": "2.0",
"method": "accountNotification",
"params": {
"result": {
"context": {
"slot": 5199307
},
"value": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHPXHRDEHrBesJhZyqnnq9qJeUuF7WHxiuLuL5twc38w2TXNLxnDbjmuR",
"base58"
],
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 635
}
},
"subscription": 23784
}
}
Parsed-JSON encoding:
{
"jsonrpc": "2.0",
"method": "accountNotification",
"params": {
"result": {
"context": {
"slot": 5199307
},
"value": {
"data": {
"program": "nonce",
"parsed": {
"type": "initialized",
"info": {
"authority": "Bbqg1M4YVVfbhEzwA9SpC9FhsaG83YMTYoR4a8oTDLX",
"blockhash": "LUaQTmM7WbMRiATdMMHaRGakPtCkc2GHtH57STKXs6k",
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
}
},
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 635
}
},
"subscription": 23784
}
}
accountUnsubscribe
Unsubscribe from account change notifications
Parameters:
<number>
- id of account Subscription to cancel
Results:
<bool>
- unsubscribe success message
Example:
Requests:
- wscat
- Web3
- Solana-py
wscat -c wss://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \
# wait for connection
{"id":1,"jsonrpc":"2.0","method": "accountUnsubscribe", "params": [0]}
const web3 = require("@solana/web3.js");
(async () => {
const solanaConnection = new web3.Connection("https://your-endpoint.hyperplane.dev", {
wsEndpoint: "wss://sample-endpoint-name.network.quiknode.pro/token-goes-here/",
});
solanaConnection.removeAccountChangeListener(0);
})();
import solana
import asyncio
from asyncstdlib import enumerate
from solana.rpc.websocket_api import connect
from solana.publickey import PublicKey
async def main():
async with connect("wss://sample-endpoint-name.network.quiknode.pro/token-goes-here/") as websocket:
await websocket.account_subscribe(PublicKey('E645TckHQnDcavVv92Etc6xSWQaq8zzPtPRGBheviRAk'))
first_resp = await websocket.recv()
subscription_id = first_resp.result
async for idx, msg in enumerate(websocket):
if idx == 3:
break
print(msg)
await websocket.account_unsubscribe(subscription_id)
asyncio.run(main())
Response:
- wscat
{ "jsonrpc": "2.0", "result": true, "id": 1 }
blockSubscribe - Unstable, disabled by default
This subscription is unstable and only available if the validator was started
with the --rpc-pubsub-enable-block-subscription
flag. The format of this
subscription may change in the future
Subscribe to receive notification anytime a new block is Confirmed or Finalized.
Parameters:
filter: <string>|<object>
- filter criteria for the logs to receive results by account type; currently supported:- "all" - include all transactions in block
{ "mentionsAccountOrProgram": <string> }
- return only transactions that mention the provided public key (as base-58 encoded string). If no mentions in a given block, then no notification will be sent.
<object>
- (optional) Configuration object containing the following optional fields:- (optional) Commitment
- (optional)
encoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd" or "jsonParsed". "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when thedata
field is type<string>
. Default is "base64". - (optional)
transactionDetails: <string>
- level of transaction detail to return, either "full", "signatures", or "none". If parameter not provided, the default detail level is "full". - (optional)
showRewards: bool
- whether to populate therewards
array. If parameter not provided, the default includes rewards.
Results:
integer
- subscription id (needed to unsubscribe)
Example:
Request:
{ "jsonrpc": "2.0", "id": "1", "method": "blockSubscribe", "params": ["all"] }
{
"jsonrpc": "2.0",
"id": "1",
"method": "blockSubscribe",
"params": [
{
"mentionsAccountOrProgram": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op"
},
{
"commitment": "confirmed",
"encoding": "base64",
"showRewards": true,
"transactionDetails": "full"
}
]
}
Result:
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
Notification Format:
The notification will be an object with the following fields:
-slot: <u64>
- The corresponding slot.
err: <object | null>
- Error if something went wrong publishing the notification otherwise null.block: <object | null>
- A block object as seen in the getBlock RPC HTTP method.
{
"jsonrpc": "2.0",
"method": "blockNotification",
"params": {
"result": {
"context": {
"slot": 112301554
},
"value": {
"slot": 112301554,
"block": {
"previousBlockhash": "GJp125YAN4ufCSUvZJVdCyWQJ7RPWMmwxoyUQySydZA",
"blockhash": "6ojMHjctdqfB55JDpEpqfHnP96fiaHEcvzEQ2NNcxzHP",
"parentSlot": 112301553,
"transactions": [
{
"transaction": [
"OpltwoUvWxYi1P2U8vbIdE/aPntjYo5Aa0VQ2JJyeJE2g9Vvxk8dDGgFMruYfDu8/IfUWb0REppTe7IpAuuLRgIBAAkWnj4KHRpEWWW7gvO1c0BHy06wZi2g7/DLqpEtkRsThAXIdBbhXCLvltw50ZnjDx2hzw74NVn49kmpYj2VZHQJoeJoYJqaKcvuxCi/2i4yywedcVNDWkM84Iuw+cEn9/ROCrXY4qBFI9dveEERQ1c4kdU46xjxj9Vi+QXkb2Kx45QFVkG4Y7HHsoS6WNUiw2m4ffnMNnOVdF9tJht7oeuEfDMuUEaO7l9JeUxppCvrGk3CP45saO51gkwVYEgKzhpKjCx3rgsYxNR81fY4hnUQXSbbc2Y55FkwgRBpVvQK7/+clR4Gjhd3L4y+OtPl7QF93Akg1LaU9wRMs5nvfDFlggqI9PqJl+IvVWrNRdBbPS8LIIhcwbRTkSbqlJQWxYg3Bo2CTVbw7rt1ZubuHWWp0mD/UJpLXGm2JprWTePNULzHu67sfqaWF99LwmwjTyYEkqkRt1T0Je5VzHgJs0N5jY4iIU9K3lMqvrKOIn/2zEMZ+ol2gdgjshx+sphIyhw65F3J/Dbzk04LLkK+CULmN571Y+hFlXF2ke0BIuUG6AUF+4214Cu7FXnqo3rkxEHDZAk0lRrAJ8X/Z+iwuwI5cgbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCpDLAp8axcEkaQkLDKRoWxqp8XLNZSKial7Rk+ELAVVKWoWLRXRZ+OIggu0OzMExvVLE5VHqy71FNHq4gGitkiKYNFWSLIE4qGfdFLZXy/6hwS+wq9ewjikCpd//C9BcCL7Wl0iQdUslxNVCBZHnCoPYih9JXvGefOb9WWnjGy14sG9j70+RSVx6BlkFELWwFvIlWR/tHn3EhHAuL0inS2pwX7ZQTAU6gDVaoqbR2EiJ47cKoPycBNvHLoKxoY9AZaBjPl6q8SKQJSFyFd9n44opAgI6zMTjYF/8Ok4VpXEESp3QaoUyTI9sOJ6oFP6f4dwnvQelgXS+AEfAsHsKXxGAIUDQENAgMEBQAGBwgIDg8IBJCER3QXl1AVDBADCQoOAAQLERITDAjb7ugh3gOuTy==",
"base64"
],
"meta": {
"err": null,
"status": {
"Ok": null
},
"fee": 5000,
"preBalances": [
1758510880, 2067120, 1566000, 1461600, 2039280, 2039280,
1900080, 1865280, 0, 3680844220, 2039280
],
"postBalances": [
1758505880, 2067120, 1566000, 1461600, 2039280, 2039280,
1900080, 1865280, 0, 3680844220, 2039280
],
"innerInstructions": [
{
"index": 0,
"instructions": [
{
"programIdIndex": 13,
"accounts": [1, 15, 3, 4, 2, 14],
"data": "21TeLgZXNbtHXVBzCaiRmH"
},
{
"programIdIndex": 14,
"accounts": [3, 4, 1],
"data": "6qfC8ic7Aq99"
},
{
"programIdIndex": 13,
"accounts": [1, 15, 3, 5, 2, 14],
"data": "21TeLgZXNbsn4QEpaSEr3q"
},
{
"programIdIndex": 14,
"accounts": [3, 5, 1],
"data": "6LC7BYyxhFRh"
}
]
},
{
"index": 1,
"instructions": [
{
"programIdIndex": 14,
"accounts": [4, 3, 0],
"data": "7aUiLHFjSVdZ"
},
{
"programIdIndex": 19,
"accounts": [17, 18, 16, 9, 11, 12, 14],
"data": "8kvZyjATKQWYxaKR1qD53V"
},
{
"programIdIndex": 14,
"accounts": [9, 11, 18],
"data": "6qfC8ic7Aq99"
}
]
}
],
"logMessages": [
"Program QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB invoke [1]",
"Program QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV invoke [2]"
],
"preTokenBalances": [
{
"accountIndex": 4,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 5,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": 11513.0679,
"decimals": 6,
"amount": "11513067900",
"uiAmountString": "11513.0679"
},
"owner": "rXhAofQCT7NN9TUqigyEAUzV1uLL4boeD8CRkNBSkYk",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 10,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "CL9wkGFT3SZRRNa9dgaovuRV7jrVVigBUZ6DjcgySsCU",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"accountIndex": 11,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": 15138.514093,
"decimals": 6,
"amount": "15138514093",
"uiAmountString": "15138.514093"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
}
],
"postTokenBalances": [
{
"accountIndex": 4,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 5,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": 11513.103028,
"decimals": 6,
"amount": "11513103028",
"uiAmountString": "11513.103028"
},
"owner": "rXhAofQCT7NN9TUqigyEAUzV1uLL4boeD8CRkNBSkYk",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 10,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "CL9wkGFT3SZRRNa9dgaovuRV7jrVVigBUZ6DjcgySsCU",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"accountIndex": 11,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": 15489.767829,
"decimals": 6,
"amount": "15489767829",
"uiAmountString": "15489.767829"
},
"owner": "BeiHVPRE8XeX3Y2xVNrSsTpAScH94nYySBVQ4HqgN9at",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
}
],
"rewards": []
}
}
],
"blockTime": 1639926816,
"blockHeight": 101210751
},
"err": null
}
},
"subscription": 14
}
}
blockUnsubscribe
Unsubscribe from block notifications
Parameters:
<integer>
- subscription id to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "blockUnsubscribe", "params": [0] }
Response:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
logsSubscribe
Subscribe to transaction logging
Parameters:
filter: <string>|<object>
- filter criteria for the logs to receive results by account type; currently supported:- "all" - subscribe to all transactions except for simple vote transactions
- "allWithVotes" - subscribe to all transactions including simple vote transactions
{ "mentions": [ <string> ] }
- subscribe to all transactions that mention the provided Pubkey (as base-58 encoded string)
<object>
- (optional) Configuration object containing the following optional fields:- (optional) Commitment
Results:
<integer>
- Subscription id (needed to unsubscribe)
Example:
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "logsSubscribe",
"params": [
{
"mentions": [ "11111111111111111111111111111111" ]
},
{
"commitment": "finalized"
}
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "logsSubscribe",
"params": [ "all" ]
}
Result:
{ "jsonrpc": "2.0", "result": 24040, "id": 1 }
Notification Format:
The notification will be an RpcResponse JSON object with value equal to:
signature: <string>
- The transaction signature base58 encoded.err: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionslogs: <array | null>
- Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)
Example:
{
"jsonrpc": "2.0",
"method": "logsNotification",
"params": {
"result": {
"context": {
"slot": 5208469
},
"value": {
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"err": null,
"logs": [
"BPF program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
]
}
},
"subscription": 24040
}
}
logsUnsubscribe
Unsubscribe from transaction logging
Parameters:
<integer>
- id of subscription to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "logsUnsubscribe", "params": [0] }
Result:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
programSubscribe
Subscribe to a program to receive notifications when the lamports or data for a given account owned by the program changes
Parameters:
<string>
- program_id Pubkey, as base-58 encoded string<object>
- (optional) Configuration object containing the following optional fields:- (optional) Commitment
encoding: <string>
- encoding for Account data, either "base58" (slow), "base64", "base64+zstd" or "jsonParsed". "jsonParsed" encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when thedata
field is type<string>
.- (optional)
filters: <array>
- filter results using various filter objects; account must meet all filter criteria to be included in results
Results:
<integer>
- Subscription id (needed to unsubscribe)
Example:
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "programSubscribe",
"params": [
"11111111111111111111111111111111",
{
"encoding": "base64",
"commitment": "finalized"
}
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "programSubscribe",
"params": [
"11111111111111111111111111111111",
{
"encoding": "jsonParsed"
}
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "programSubscribe",
"params": [
"11111111111111111111111111111111",
{
"encoding": "base64",
"filters": [
{
"dataSize": 80
}
]
}
]
}
Result:
{ "jsonrpc": "2.0", "result": 24040, "id": 1 }
Notification Format:
The notification format is a single program account object as seen in the getProgramAccounts RPC HTTP method.
Base58 encoding:
{
"jsonrpc": "2.0",
"method": "programNotification",
"params": {
"result": {
"context": {
"slot": 5208469
},
"value": {
"pubkey": "H4vnBqifaSACnKa7acsxstsY1iV1bvJNxsCY7enrd1hq",
"account": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHPXHRDEHrBesJhZyqnnq9qJeUuF7WHxiuLuL5twc38w2TXNLxnDbjmuR",
"base58"
],
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 636
}
}
},
"subscription": 24040
}
}
Parsed-JSON encoding:
{
"jsonrpc": "2.0",
"method": "programNotification",
"params": {
"result": {
"context": {
"slot": 5208469
},
"value": {
"pubkey": "H4vnBqifaSACnKa7acsxstsY1iV1bvJNxsCY7enrd1hq",
"account": {
"data": {
"program": "nonce",
"parsed": {
"type": "initialized",
"info": {
"authority": "Bbqg1M4YVVfbhEzwA9SpC9FhsaG83YMTYoR4a8oTDLX",
"blockhash": "LUaQTmM7WbMRiATdMMHaRGakPtCkc2GHtH57STKXs6k",
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
}
},
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 636
}
}
},
"subscription": 24040
}
}
programUnsubscribe
Unsubscribe from program-owned account change notifications
Parameters:
<integer>
- id of account Subscription to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "programUnsubscribe", "params": [0] }
Result:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
signatureSubscribe
Subscribe to a transaction signature to receive notification when the transaction is confirmed On signatureNotification
, the subscription is automatically cancelled
Parameters:
<string>
- Transaction Signature, as base-58 encoded string<object>
- (optional) Commitment
Results:
integer
- subscription id (needed to unsubscribe)
Example:
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "signatureSubscribe",
"params": [
"2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b"
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "signatureSubscribe",
"params": [
"2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b",
{
"commitment": "finalized"
}
]
}
Result:
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
Notification Format:
The notification will be an RpcResponse JSON object with value containing an object with:
err: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitions
Example:
{
"jsonrpc": "2.0",
"method": "signatureNotification",
"params": {
"result": {
"context": {
"slot": 5207624
},
"value": {
"err": null
}
},
"subscription": 24006
}
}
signatureUnsubscribe
Unsubscribe from signature confirmation notification
Parameters:
<integer>
- subscription id to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "signatureUnsubscribe", "params": [0] }
Result:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
slotSubscribe
Subscribe to receive notification anytime a slot is processed by the validator
Parameters:
None
Results:
integer
- subscription id (needed to unsubscribe)
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "slotSubscribe" }
Result:
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
Notification Format:
The notification will be an object with the following fields:
parent: <u64>
- The parent slotroot: <u64>
- The current root slotslot: <u64>
- The newly set slot value
Example:
{
"jsonrpc": "2.0",
"method": "slotNotification",
"params": {
"result": {
"parent": 75,
"root": 44,
"slot": 76
},
"subscription": 0
}
}
slotUnsubscribe
Unsubscribe from slot notifications
Parameters:
<integer>
- subscription id to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "slotUnsubscribe", "params": [0] }
Result:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
slotsUpdatesSubscribe - Unstable
This subscription is unstable; the format of this subscription may change in the future and it may not always be supported
Subscribe to receive a notification from the validator on a variety of updates on every slot
Parameters:
None
Results:
integer
- subscription id (needed to unsubscribe)
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "slotsUpdatesSubscribe" }
Result:
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
Notification Format:
The notification will be an object with the following fields:
parent: <u64>
- The parent slotslot: <u64>
- The newly updated slottimestamp: <i64>
- The Unix timestamp of the updatetype: <string>
- The update type, one of:- "firstShredReceived"
- "completed"
- "createdBank"
- "frozen"
- "dead"
- "optimisticConfirmation"
- "root"
{
"jsonrpc": "2.0",
"method": "slotsUpdatesNotification",
"params": {
"result": {
"parent": 75,
"slot": 76,
"timestamp": 1625081266243,
"type": "optimisticConfirmation"
},
"subscription": 0
}
}
slotsUpdatesUnsubscribe
Unsubscribe from slot-update notifications
Parameters:
<integer>
- subscription id to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "slotsUpdatesUnsubscribe",
"params": [0]
}
Result:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
rootSubscribe
Subscribe to receive notification anytime a new root is set by the validator.
Parameters:
None
Results:
integer
- subscription id (needed to unsubscribe)
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "rootSubscribe" }
Result:
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
Notification Format:
The result is the latest root slot number.
{
"jsonrpc": "2.0",
"method": "rootNotification",
"params": {
"result": 42,
"subscription": 0
}
}
rootUnsubscribe
Unsubscribe from root notifications
Parameters:
<integer>
- subscription id to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "rootUnsubscribe", "params": [0] }
Result:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
voteSubscribe - Unstable, disabled by default
This subscription is unstable and only available if the validator was started
with the --rpc-pubsub-enable-vote-subscription
flag. The format of this
subscription may change in the future
Subscribe to receive notification anytime a new vote is observed in gossip. These votes are pre-consensus therefore there is no guarantee these votes will enter the ledger.
Parameters:
None
Results:
integer
- subscription id (needed to unsubscribe)
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "voteSubscribe" }
Result:
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
Notification Format:
The notification will be an object with the following fields:
hash: <string>
- The vote hashslots: <array>
- The slots covered by the vote, as an array of u64 integerstimestamp: <i64 | null>
- The timestamp of the votesignature: <string>
- The signature of the transaction that contained this vote
{
"jsonrpc": "2.0",
"method": "voteNotification",
"params": {
"result": {
"hash": "8Rshv2oMkPu5E4opXTRyuyBeZBqQ4S477VG26wUTFxUM",
"slots": [1, 2],
"timestamp": null
},
"subscription": 0
}
}
voteUnsubscribe
Unsubscribe from vote notifications
Parameters:
<integer>
- subscription id to cancel
Results:
<bool>
- unsubscribe success message
Example:
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "voteUnsubscribe", "params": [0] }
Response:
{ "jsonrpc": "2.0", "result": true, "id": 1 }
JSON RPC API Deprecated Methods
getConfirmedBlock
DEPRECATED: Please use getBlock instead This method is expected to be removed in solana-core v2.0
Returns identity and transaction information about a confirmed block in the ledger
Parameters:
<u64>
- slot, as u64 integer<object>
- (optional) Configuration object containing the following optional fields:- (optional)
encoding: <string>
- encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". "jsonParsed" encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in thetransaction.message.instructions
list. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts
,data
, andprogramIdIndex
fields). - (optional)
transactionDetails: <string>
- level of transaction detail to return, either "full", "signatures", or "none". If parameter not provided, the default detail level is "full". - (optional)
rewards: bool
- whether to populate therewards
array. If parameter not provided, the default includes rewards. - (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
- (optional)
Results:
The result field will be an object with the following fields:
<null>
- if specified block is not confirmed<object>
- if block is confirmed, an object with the following fields:blockhash: <string>
- the blockhash of this block, as base-58 encoded stringpreviousBlockhash: <string>
- the blockhash of this block's parent, as base-58 encoded string; if the parent block is not available due to ledger cleanup, this field will return "11111111111111111111111111111111"parentSlot: <u64>
- the slot index of this block's parenttransactions: <array>
- present if "full" transaction details are requested; an array of JSON objects containing:transaction: <object|[string,encoding]>
- Transaction object, either in JSON format or encoded binary data, depending on encoding parametermeta: <object>
- transaction status metadata object, containingnull
or:err: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionsfee: <u64>
- fee this transaction was charged, as u64 integerpreBalances: <array>
- array of u64 account balances from before the transaction was processedpostBalances: <array>
- array of u64 account balances after the transaction was processedinnerInstructions: <array|null>
- List of inner instructions ornull
if inner instruction recording was not enabled during this transactionpreTokenBalances: <array|undefined>
- List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transactionpostTokenBalances: <array|undefined>
- List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transactionlogMessages: <array|null>
- array of string log messages ornull
if log message recording was not enabled during this transaction- DEPRECATED:
status: <object>
- Transaction status"Ok": <null>
- Transaction was successful"Err": <ERR>
- Transaction failed with TransactionError
signatures: <array>
- present if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the blockrewards: <array>
- present if rewards are requested; an array of JSON objects containing:pubkey: <string>
- The public key, as base-58 encoded string, of the account that received the rewardlamports: <i64>
- number of reward lamports credited or debited by the account, as a i64postBalance: <u64>
- account balance in lamports after the reward was appliedrewardType: <string|undefined>
- type of reward: "fee", "rent", "voting", "staking"commission: <u8|undefined>
- vote account commission when the reward was credited, only present for voting and staking rewards
blockTime: <i64 | null>
- estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlock","params":[430, {"encoding": "json","transactionDetails":"full","rewards":false}]}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"transactions": [
{
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"logMessages": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"transaction": {
"message": {
"accountKeys": [
"3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
"AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
"SysvarS1otHashes111111111111111111111111111",
"SysvarC1ock11111111111111111111111111111111",
"Vote111111111111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 3,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [1, 2, 3, 0],
"data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
"programIdIndex": 4
}
],
"recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
},
"signatures": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
]
}
}
]
},
"id": 1
}
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlock","params":[430, "base64"]}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"rewards": [],
"transactions": [
{
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"logMessages": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"transaction": [
"AVj7dxHlQ9IrvdYVIjuiRFs1jLaDMHixgrv+qtHBwz51L4/ImLZhszwiyEJDIp7xeBSpm/TX5B7mYzxa+fPOMw0BAAMFJMJVqLw+hJYheizSoYlLm53KzgT82cDVmazarqQKG2GQsLgiqktA+a+FDR4/7xnDX7rsusMwryYVUdixfz1B1Qan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAAtxOUhPBp2WSjUNJEgfvy70BbxI00fZyEPvFHNfxrtEAQQEAQIDADUCAAAAAQAAAAAAAACtAQAAAAAAAAdUE18R96XTJCe+YfRfUp6WP+YKCy/72ucOL8AoBFSpAA==",
"base64"
]
}
]
},
"id": 1
}
For more details on returned data: Transaction Structure Inner Instructions Structure Token Balances Structure
getConfirmedBlocks
DEPRECATED: Please use getBlocks instead This method is expected to be removed in solana-core v2.0
Returns a list of confirmed blocks between two slots
Parameters:
<u64>
- start_slot, as u64 integer<u64>
- (optional) end_slot, as u64 integer- (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
Results:
The result field will be an array of u64 integers listing confirmed blocks
between start_slot
and either end_slot
, if provided, or latest confirmed block,
inclusive. Max range allowed is 500,000 slots.
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlocks","params":[5, 10]}
'
Result:
{ "jsonrpc": "2.0", "result": [5, 6, 7, 8, 9, 10], "id": 1 }
getConfirmedBlocksWithLimit
DEPRECATED: Please use getBlocksWithLimit instead This method is expected to be removed in solana-core v2.0
Returns a list of confirmed blocks starting at the given slot
Parameters:
<u64>
- start_slot, as u64 integer<u64>
- limit, as u64 integer- (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
Results:
The result field will be an array of u64 integers listing confirmed blocks
starting at start_slot
for up to limit
blocks, inclusive.
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlocksWithLimit","params":[5, 3]}
'
Result:
{ "jsonrpc": "2.0", "result": [5, 6, 7], "id": 1 }
getConfirmedSignaturesForAddress2
DEPRECATED: Please use getSignaturesForAddress instead This method is expected to be removed in solana-core v2.0
Returns signatures for confirmed transactions that include the given address in
their accountKeys
list. Returns signatures backwards in time from the
provided signature or most recent confirmed block
Parameters:
<string>
- account address as base-58 encoded string<object>
- (optional) Configuration object containing the following fields:limit: <number>
- (optional) maximum transaction signatures to return (between 1 and 1,000, default: 1,000).before: <string>
- (optional) start searching backwards from this transaction signature. If not provided the search starts from the top of the highest max confirmed block.until: <string>
- (optional) search until this transaction signature, if found before limit reached.- (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
Results:
The result field will be an array of transaction signature information, ordered from newest to oldest transaction:
<object>
signature: <string>
- transaction signature as base-58 encoded stringslot: <u64>
- The slot that contains the block with the transactionerr: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionsmemo: <string |null>
- Memo associated with the transaction, null if no memo is presentblockTime: <i64 | null>
- estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getConfirmedSignaturesForAddress2",
"params": [
"Vote111111111111111111111111111111111111111",
{
"limit": 1
}
]
}
'
Result:
{
"jsonrpc": "2.0",
"result": [
{
"err": null,
"memo": null,
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"slot": 114,
"blockTime": null
}
],
"id": 1
}
getConfirmedTransaction
DEPRECATED: Please use getTransaction instead This method is expected to be removed in solana-core v2.0
Returns transaction details for a confirmed transaction
Parameters:
<string>
- transaction signature as base-58 encoded string<object>
- (optional) Configuration object containing the following optional fields:- (optional)
encoding: <string>
- encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". "jsonParsed" encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in thetransaction.message.instructions
list. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts
,data
, andprogramIdIndex
fields). - (optional) Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
- (optional)
Results:
<null>
- if transaction is not found or not confirmed<object>
- if transaction is confirmed, an object with the following fields:slot: <u64>
- the slot this transaction was processed intransaction: <object|[string,encoding]>
- Transaction object, either in JSON format or encoded binary data, depending on encoding parameterblockTime: <i64 | null>
- estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not availablemeta: <object | null>
- transaction status metadata object:err: <object | null>
- Error if transaction failed, null if transaction succeeded. TransactionError definitionsfee: <u64>
- fee this transaction was charged, as u64 integerpreBalances: <array>
- array of u64 account balances from before the transaction was processedpostBalances: <array>
- array of u64 account balances after the transaction was processedinnerInstructions: <array|null>
- List of inner instructions ornull
if inner instruction recording was not enabled during this transactionpreTokenBalances: <array|undefined>
- List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transactionpostTokenBalances: <array|undefined>
- List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transactionlogMessages: <array|null>
- array of string log messages ornull
if log message recording was not enabled during this transaction- DEPRECATED:
status: <object>
- Transaction status"Ok": <null>
- Transaction was successful"Err": <ERR>
- Transaction failed with TransactionError
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getConfirmedTransaction",
"params": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
"json"
]
}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"slot": 430,
"transaction": {
"message": {
"accountKeys": [
"3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
"AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
"SysvarS1otHashes111111111111111111111111111",
"SysvarC1ock11111111111111111111111111111111",
"Vote111111111111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 3,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [1, 2, 3, 0],
"data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
"programIdIndex": 4
}
],
"recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
},
"signatures": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
]
}
},
"blockTime": null,
"id": 1
}
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getConfirmedTransaction",
"params": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
"base64"
]
}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"slot": 430,
"transaction": [
"AVj7dxHlQ9IrvdYVIjuiRFs1jLaDMHixgrv+qtHBwz51L4/ImLZhszwiyEJDIp7xeBSpm/TX5B7mYzxa+fPOMw0BAAMFJMJVqLw+hJYheizSoYlLm53KzgT82cDVmazarqQKG2GQsLgiqktA+a+FDR4/7xnDX7rsusMwryYVUdixfz1B1Qan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAAtxOUhPBp2WSjUNJEgfvy70BbxI00fZyEPvFHNfxrtEAQQEAQIDADUCAAAAAQAAAAAAAACtAQAAAAAAAAdUE18R96XTJCe+YfRfUp6WP+YKCy/72ucOL8AoBFSpAA==",
"base64"
]
},
"id": 1
}
getFeeCalculatorForBlockhash
DEPRECATED: Please use isBlockhashValid or getFeeForMessage instead This method is expected to be removed in solana-core v2.0
Returns the fee calculator associated with the query blockhash, or null
if the blockhash has expired
Parameters:
<string>
- query blockhash as a Base58 encoded string<object>
- (optional) Configuration object containing the following fields:- (optional)
commitment: <string>
- Commitment - (optional)
minContextSlot: <number>
- set the minimum slot that the request can be evaluated at.
- (optional)
Results:
The result will be an RpcResponse JSON object with value
equal to:
<null>
- if the query blockhash has expired<object>
- otherwise, a JSON object containing:feeCalculator: <object>
,FeeCalculator
object describing the cluster fee rate at the queried blockhash
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getFeeCalculatorForBlockhash",
"params": [
"GJxqhuxcgfn5Tcj6y3f8X4FeCDd2RQ6SnEMo1AAxrPRZ"
]
}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 221
},
"value": {
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
},
"id": 1
}
getFeeRateGovernor
Returns the fee rate governor information from the root bank
Parameters:
None
Results:
The result
field will be an object
with the following fields:
burnPercent: <u8>
, Percentage of fees collected to be destroyedmaxLamportsPerSignature: <u64>
, Largest valuelamportsPerSignature
can attain for the next slotminLamportsPerSignature: <u64>
, Smallest valuelamportsPerSignature
can attain for the next slottargetLamportsPerSignature: <u64>
, Desired fee rate for the clustertargetSignaturesPerSlot: <u64>
, Desired signature rate for the cluster
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getFeeRateGovernor"}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 54
},
"value": {
"feeRateGovernor": {
"burnPercent": 50,
"maxLamportsPerSignature": 100000,
"minLamportsPerSignature": 5000,
"targetLamportsPerSignature": 10000,
"targetSignaturesPerSlot": 20000
}
}
},
"id": 1
}
getFees
DEPRECATED: Please use getFeeForMessage instead This method is expected to be removed in solana-core v2.0
Returns a recent block hash from the ledger, a fee schedule that can be used to compute the cost of submitting a transaction using it, and the last slot in which the blockhash will be valid.
Parameters:
<object>
- (optional) Commitment
Results:
The result will be an RpcResponse JSON object with value
set to a JSON object with the following fields:
blockhash: <string>
- a Hash as base-58 encoded stringfeeCalculator: <object>
- FeeCalculator object, the fee schedule for this block hashlastValidSlot: <u64>
- DEPRECATED - this value is inaccurate and should not be relied uponlastValidBlockHeight: <u64>
- last block height at which the blockhash will be valid
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getFees"}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1
},
"value": {
"blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR",
"feeCalculator": {
"lamportsPerSignature": 5000
},
"lastValidSlot": 297,
"lastValidBlockHeight": 296
}
},
"id": 1
}
getRecentBlockhash
DEPRECATED: Please use getLatestBlockhash instead This method is expected to be removed in solana-core v2.0
Returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it.
Parameters:
<object>
- (optional) Commitment
Results:
An RpcResponse containing a JSON object consisting of a string blockhash and FeeCalculator JSON object.
RpcResponse<object>
- RpcResponse JSON object withvalue
field set to a JSON object including:blockhash: <string>
- a Hash as base-58 encoded stringfeeCalculator: <object>
- FeeCalculator object, the fee schedule for this block hash
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"}
'
Result:
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1
},
"value": {
"blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR",
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
},
"id": 1
}
getSnapshotSlot
DEPRECATED: Please use getHighestSnapshotSlot instead This method is expected to be removed in solana-core v2.0
Returns the highest slot that the node has a snapshot for
Parameters:
None
Results:
<u64>
- Snapshot slot
Example:
Request:
curl https://your-endpoint.hyperplane.dev -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSnapshotSlot"}
'
Result:
{ "jsonrpc": "2.0", "result": 100, "id": 1 }
Result when the node has no snapshot:
{
"jsonrpc": "2.0",
"error": { "code": -32008, "message": "No snapshot" },
"id": 1
}